January 2018
Beginner to intermediate
454 pages
10h 8m
English
When writing a library, it is very easy to forget to write the documentation about every item. But, we can use the help of the tools at our disposal. By adding the #[warn(missing_docs)] attribute in our crate's root, the compiler will warn us when public items do not have a doc-comment. In such a case, it will print something like this:
warning: missing documentation for crate
--> src/main.rs:9:1
|
9 | / #![feature(proc_macro, conservative_impl_trait, generators)]
10 | | #![warn(missing_docs)]
11 | |
12 | | extern crate bytes;
... |
528 | | }
529 | | }
| |_^
|
note: lint level defined here
--> src/main.rs:10:9
|
10 | #![warn(missing_docs)]
| ^^^^^^^^^^^^