diff options
| author | bors <bors@rust-lang.org> | 2014-08-22 11:50:58 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-08-22 11:50:58 +0000 |
| commit | b9326ca91c9515ae1b1ba48c2a942d5bd65a3bab (patch) | |
| tree | 1250e68dde31ad91ee50782496807054984a4ee8 | |
| parent | 19a44c73c246ad98f285aa801433beca674b1ad4 (diff) | |
| parent | f6759924f45f0ea76b115622133a66e885a49d1b (diff) | |
| download | rust-b9326ca91c9515ae1b1ba48c2a942d5bd65a3bab.tar.gz rust-b9326ca91c9515ae1b1ba48c2a942d5bd65a3bab.zip | |
auto merge of #16653 : steveklabnik/rust/module_wording, r=alexcrichton
@kimundi was a bit worried this was misleading.
| -rw-r--r-- | src/doc/guide.md | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/doc/guide.md b/src/doc/guide.md index 9fa5f933e30..d011c9932fa 100644 --- a/src/doc/guide.md +++ b/src/doc/guide.md @@ -2896,9 +2896,11 @@ pub fn print_hello() { } ``` -When we include a module like this, we don't need to make the `mod` declaration, -it's just understood. This helps prevent 'rightward drift': when you end up -indenting so many times that your code is hard to read. +When we include a module like this, we don't need to make the `mod` declaration +in `hello.rs`, because it's already been declared in `lib.rs`. `hello.rs` just +contains the body of the module which is defined (by the `pub mod hello`) in +`lib.rs`. This helps prevent 'rightward drift': when you end up indenting so +many times that your code is hard to read. Finally, make a new directory, `src/goodbye`, and make a new file in it, `src/goodbye/mod.rs`: |
