Skip to content

Commit 2683090

Browse files
committed
Ch. 4: further tweaks to explanatory comment in Listing 4.8
1 parent 1f928fc commit 2683090

File tree

1,421 files changed

+103940
-19391
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,421 files changed

+103940
-19391
lines changed
File renamed without changes.

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Ran dprint fmt on the repo
2+
3a30e4c1fbe641afc066b3af9eb01dcdf5ed8b24

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ name: Bug report
33
about: Create a report to help us improve
44
---
55

6-
- [ ] I have checked the latest `main` branch to see if this has already been fixed
7-
- [ ] I have searched existing issues and pull requests for duplicates
6+
- I have searched open and closed issues and pull requests for duplicates, using these search terms:
7+
-
8+
-
9+
-
10+
- I have checked the latest `main` branch to see if this has already been fixed, in this file:
11+
-
812

913
URL to the section(s) of the book with this problem:
1014

.github/workflows/main.yml

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,50 @@ jobs:
1212
- name: Install Rust
1313
run: |
1414
rustup set profile minimal
15-
rustup toolchain install 1.59 -c rust-docs
16-
rustup default 1.59
15+
rustup toolchain install 1.82 -c rust-docs
16+
rustup default 1.82
1717
- name: Install mdbook
1818
run: |
1919
mkdir bin
20-
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.14/mdbook-v0.4.14-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
21-
echo "$(pwd)/bin" >> ${GITHUB_PATH}
20+
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.21/mdbook-v0.4.21-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
21+
echo "$(pwd)/bin" >> "${GITHUB_PATH}"
2222
- name: Report versions
2323
run: |
2424
rustup --version
2525
rustc -Vv
2626
mdbook --version
27+
28+
# mdBook does not currently have particularly good support for “external”
29+
# crates. To make the test suite work correctly with `trpl`, we must first
30+
# build `trpl` itself (`mdbook` will not do it), and then explicitly pass
31+
# its `deps` path as a library search path for `mdbook test`. That will make
32+
# sure all the crates can be resolved when running the tests.
33+
- name: Build `trpl` crate
34+
run: |
35+
cd packages/trpl
36+
cargo build
2737
- name: Run tests
28-
run: mdbook test
38+
run:
39+
mdbook test --library-path packages/trpl/target/debug/deps
40+
package_tests:
41+
name: Run package tests
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@master
45+
- name: Update rustup
46+
run: rustup self update
47+
- name: Install Rust
48+
run: |
49+
rustup set profile minimal
50+
rustup toolchain install 1.82 -c rust-docs
51+
rustup default 1.82
52+
- name: Run `tools` package tests
53+
run: |
54+
cargo test
55+
- name: Run `mdbook-trpl` package tests
56+
working-directory: packages/mdbook-trpl
57+
run: |
58+
cargo test
2959
lint:
3060
name: Run lints
3161
runs-on: ubuntu-latest
@@ -41,8 +71,10 @@ jobs:
4171
- name: Install mdbook
4272
run: |
4373
mkdir bin
44-
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.14/mdbook-v0.4.14-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
45-
echo "$(pwd)/bin" >> ${GITHUB_PATH}
74+
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.21/mdbook-v0.4.21-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
75+
echo "$(pwd)/bin" >> "${GITHUB_PATH}"
76+
- name: Install mdbook-trpl binaries
77+
run: cargo install --path packages/mdbook-trpl
4678
- name: Install aspell
4779
run: sudo apt-get install aspell
4880
- name: Install shellcheck
@@ -55,7 +87,7 @@ jobs:
5587
aspell --version
5688
shellcheck --version
5789
- name: Shellcheck
58-
run: find . -name '*.sh' | xargs shellcheck
90+
run: find . -name '*.sh' -print0 | xargs -0 shellcheck
5991
- name: Spellcheck
6092
run: bash ci/spellcheck.sh list
6193
- name: Lint for local file paths

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ book/
55
target
66
tmp
77

8+
.nova
9+
.vscode
10+
.zed

2018-edition/book.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ title = "The Rust Programming Language"
33
author = "Steve Klabnik and Carol Nichols, with Contributions from the Rust Community"
44

55
[output.html]
6-
additional-css = ["ferris.css", "src/theme/2018-edition.css"]
6+
additional-css = ["ferris.css"]
77
additional-js = ["ferris.js"]

2018-edition/src/ch17-00-oop.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
The 2018 edition of the book is no longer distributed with Rust's documentation.
44

55
If you came here via a link or web search, you may want to check out [the current
6-
version of the book](../ch17-00-oop.html) instead.
6+
version of the book](../ch18-00-oop.html) instead.
77

88
If you have an internet connection, you can [find a copy distributed with
99
Rust
10-
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch17-00-oop.html).
10+
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch17-00-oop.html).

2018-edition/src/ch17-01-what-is-oo.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
The 2018 edition of the book is no longer distributed with Rust's documentation.
44

55
If you came here via a link or web search, you may want to check out [the current
6-
version of the book](../ch17-01-what-is-oo.html) instead.
6+
version of the book](../ch18-01-what-is-oo.html) instead.
77

88
If you have an internet connection, you can [find a copy distributed with
99
Rust
10-
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch17-01-what-is-oo.html).
10+
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch17-01-what-is-oo.html).

2018-edition/src/ch17-02-trait-objects.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
The 2018 edition of the book is no longer distributed with Rust's documentation.
44

55
If you came here via a link or web search, you may want to check out [the current
6-
version of the book](../ch17-02-trait-objects.html) instead.
6+
version of the book](../ch18-02-trait-objects.html) instead.
77

88
If you have an internet connection, you can [find a copy distributed with
99
Rust
10-
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch17-02-trait-objects.html).
10+
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch17-02-trait-objects.html).

2018-edition/src/ch17-03-oo-design-patterns.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
The 2018 edition of the book is no longer distributed with Rust's documentation.
44

55
If you came here via a link or web search, you may want to check out [the current
6-
version of the book](../ch17-03-oo-design-patterns.html) instead.
6+
version of the book](../ch18-03-oo-design-patterns.html) instead.
77

88
If you have an internet connection, you can [find a copy distributed with
99
Rust
10-
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch17-03-oo-design-patterns.html).
10+
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch17-03-oo-design-patterns.html).

0 commit comments

Comments
 (0)