Skip to content

Commit f675992

Browse files
committed
fix module wording in guide
@Kimundi was a bit worried this was misleading.
1 parent 655600b commit f675992

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/doc/guide.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2884,9 +2884,11 @@ pub fn print_hello() {
28842884
}
28852885
```
28862886

2887-
When we include a module like this, we don't need to make the `mod` declaration,
2888-
it's just understood. This helps prevent 'rightward drift': when you end up
2889-
indenting so many times that your code is hard to read.
2887+
When we include a module like this, we don't need to make the `mod` declaration
2888+
in `hello.rs`, because it's already been declared in `lib.rs`. `hello.rs` just
2889+
contains the body of the module which is defined (by the `pub mod hello`) in
2890+
`lib.rs`. This helps prevent 'rightward drift': when you end up indenting so
2891+
many times that your code is hard to read.
28902892

28912893
Finally, make a new directory, `src/goodbye`, and make a new file in it,
28922894
`src/goodbye/mod.rs`:

0 commit comments

Comments
 (0)