Skip to content

Commit a598c74

Browse files
committed
Rollup merge of rust-lang#32634 - varunvats:docs-fix, r=steveklabnik
Minor doc fixes in "Crates and Modules" and "Lifetimes" chapters These commits fix a couple of (minor) issues in the _Crates and Modules_ and the _Lifetimes_ chapters of the book. r? @steveklabnik
2 parents 309527b + a7d15ce commit a598c74

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
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

src/doc/book/lifetimes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ To fix this, we have to make sure that step four never happens after step
5656
three. The ownership system in Rust does this through a concept called
5757
lifetimes, which describe the scope that a reference is valid for.
5858

59-
When we have a function that takes a reference by argument, we can be implicit
60-
or explicit about the lifetime of the reference:
59+
When we have a function that takes an argument by reference, we can be
60+
implicit or explicit about the lifetime of the reference:
6161

6262
```rust
6363
// implicit

0 commit comments

Comments
 (0)