Skip to content

Commit a7d15ce

Browse files
Varun VatsVarun Vats
Varun Vats
authored and
Varun Vats
committed
Doc fix: list all module files Rust looks for.
1. In the English/Japanese phrases example in the "Multiple File Crates" section of the "Crates and Modules" chapter, there are a total of 8 module files that Rust looks for, while only four were listed. This commit lists all 8 explicitly. 2. Title case fix.
1 parent d841c15 commit a7d15ce

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

src/doc/book/crates-and-modules.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ build deps examples libphrases-a7448e02a0468eaa.rlib native
118118
`libphrases-hash.rlib` is the compiled crate. Before we see how to use this
119119
crate from another crate, let’s break it up into multiple files.
120120

121-
# Multiple file crates
121+
# Multiple File Crates
122122

123123
If each crate were just one file, these files would get very large. It’s often
124124
easier to split up crates into multiple files, and Rust supports this in two
@@ -190,13 +190,19 @@ mod farewells;
190190
```
191191

192192
Again, these declarations tell Rust to look for either
193-
`src/english/greetings.rs` and `src/japanese/greetings.rs` or
194-
`src/english/farewells/mod.rs` and `src/japanese/farewells/mod.rs`. Because
195-
these sub-modules don’t have their own sub-modules, we’ve chosen to make them
196-
`src/english/greetings.rs` and `src/japanese/farewells.rs`. Whew!
197-
198-
The contents of `src/english/greetings.rs` and `src/japanese/farewells.rs` are
199-
both empty at the moment. Let’s add some functions.
193+
`src/english/greetings.rs`, `src/english/farewells.rs`,
194+
`src/japanese/greetings.rs` and `src/japanese/farewells.rs` or
195+
`src/english/greetings/mod.rs`, `src/english/farewells/mod.rs`,
196+
`src/japanese/greetings/mod.rs` and
197+
`src/japanese/farewells/mod.rs`. Because these sub-modules don’t have
198+
their own sub-modules, we’ve chosen to make them
199+
`src/english/greetings.rs`, `src/english/farewells.rs`,
200+
`src/japanese/greetings.rs` and `src/japanese/farewells.rs`. Whew!
201+
202+
The contents of `src/english/greetings.rs`,
203+
`src/english/farewells.rs`, `src/japanese/greetings.rs` and
204+
`src/japanese/farewells.rs` are all empty at the moment. Let’s add
205+
some functions.
200206

201207
Put this in `src/english/greetings.rs`:
202208

0 commit comments

Comments
 (0)