Skip to content

Commit

Permalink
Auto merge of rust-lang#26820 - liigo:patch-2, r=steveklabnik
Browse files Browse the repository at this point in the history
  • Loading branch information
bors committed Jul 6, 2015
2 parents 9748574 + 03afbf9 commit 7b78538
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/doc/trpl/comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ fn add_one(x: i32) -> i32 {
}
```

There is another style of doc comment, `//!`, to comment containing items (e.g.
crates, modules or functions), instead of the items following it. Commonly used
inside crates root (lib.rs) or modules root (mod.rs):

```
//! # The Rust Standard Library
//!
//! The Rust Standard Library provides the essential runtime
//! functionality for building portable Rust software.
```

When writing doc comments, providing some examples of usage is very, very
helpful. You’ll notice we’ve used a new macro here: `assert_eq!`. This compares
two values, and `panic!`s if they’re not equal to each other. It’s very helpful
Expand Down

0 comments on commit 7b78538

Please sign in to comment.