Skip to Content
Rust Programming By Example
book

Rust Programming By Example

by Guillaume Gomez, Antoni Boucher
January 2018
Beginner to intermediate
454 pages
10h 8m
English
Packt Publishing
Content preview from Rust Programming By Example

Warning about public items without documentation

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)]
    |         ^^^^^^^^^^^^
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Rust Programming Cookbook

Rust Programming Cookbook

Claus Matzinger
Rust Web Programming

Rust Web Programming

Maxwell Flitton

Publisher Resources

ISBN: 9781788390637Supplemental Content