Skip to content

Commit 10f9f30

Browse files
Rollup merge of #33558 - bnewbold:trivial-book-tweaks, r=steveklabnik
trivial tweaks to documentation (book) These are small things I found while reading through The Book. The `<hash>` and `panic!` lines are simply to improve readability, while I believe the proceeding/following distinction is a bug (but might be a English dialect distinction?). I've read `rust/CONTRIBUTING`, i'm not sure if there is anything I need to do other than submit this PR. r? @steveklabnik
2 parents 3bb96ab + 8e8f391 commit 10f9f30

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ $ ls target/debug
115115
build deps examples libphrases-a7448e02a0468eaa.rlib native
116116
```
117117

118-
`libphrases-hash.rlib` is the compiled crate. Before we see how to use this
118+
`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

121121
# Multiple File Crates

src/doc/book/error-handling.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ sense to put it into a function:
225225
```rust
226226
# fn find(_: &str, _: char) -> Option<usize> { None }
227227
// Returns the extension of the given file name, where the extension is defined
228-
// as all characters proceeding the first `.`.
228+
// as all characters following the first `.`.
229229
// If `file_name` has no `.`, then `None` is returned.
230230
fn extension_explicit(file_name: &str) -> Option<&str> {
231231
match find(file_name, '.') {
@@ -274,7 +274,7 @@ to get rid of the case analysis:
274274
```rust
275275
# fn find(_: &str, _: char) -> Option<usize> { None }
276276
// Returns the extension of the given file name, where the extension is defined
277-
// as all characters proceeding the first `.`.
277+
// as all characters following the first `.`.
278278
// If `file_name` has no `.`, then `None` is returned.
279279
fn extension(file_name: &str) -> Option<&str> {
280280
find(file_name, '.').map(|i| &file_name[i+1..])

src/doc/book/testing.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ fn it_works() {
8484
```
8585

8686
`assert!` is a macro provided by Rust which takes one argument: if the argument
87-
is `true`, nothing happens. If the argument is `false`, it `panic!`s. Let's run
88-
our tests again:
87+
is `true`, nothing happens. If the argument is `false`, it will `panic!`. Let's
88+
run our tests again:
8989

9090
```bash
9191
$ cargo test

0 commit comments

Comments
 (0)