rust-lang-nursery / lazy-static.rs

A small macro for defining lazy evaluated static variables in Rust.
Apache License 2.0
1.9k stars 111 forks source link

docs - add hint that doc-tests are supported #168

Open noah04 opened 4 years ago

noah04 commented 4 years ago

The documentations introductory section about the basic syntax says:

Attributes (including doc comments) are supported as well.

While reading it, I wondered if doc-tests are also supported. I tried it myself and it worked quite well. Is this an intended feature? If so, I'd like to create a PR to include that in the docs (maybe also with an example).

Cheers and thanks for your work!

LukasKalbertodt commented 4 years ago

Yes, this is intended. Supporting doc comments kind of implies supporting doc tests. But I guess it doesn't hurt to mention it explicitly, so feel free to open a PR!