Skip to content

Commit

Permalink
Integrate and update 'veera-sivarajan:add-letElse'
Browse files Browse the repository at this point in the history
- Merge in changes from `main`, including moving the chapter.
- Merge in newly-written introduction of `let-else` in the same section
  as the `if let` discussion.
- Rewrap lines.
  • Loading branch information
chriskrycho committed Dec 13, 2024
3 parents e4e9ba7 + e78a93c + d8792a4 commit 3c4873b
Show file tree
Hide file tree
Showing 1,221 changed files with 96,732 additions and 12,629 deletions.
File renamed without changes.
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ran dprint fmt on the repo
3a30e4c1fbe641afc066b3af9eb01dcdf5ed8b24
44 changes: 38 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,50 @@ jobs:
- name: Install Rust
run: |
rustup set profile minimal
rustup toolchain install 1.67 -c rust-docs
rustup default 1.67
rustup toolchain install 1.82 -c rust-docs
rustup default 1.82
- name: Install mdbook
run: |
mkdir bin
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
echo "$(pwd)/bin" >> ${GITHUB_PATH}
echo "$(pwd)/bin" >> "${GITHUB_PATH}"
- name: Report versions
run: |
rustup --version
rustc -Vv
mdbook --version
# mdBook does not currently have particularly good support for “external”
# crates. To make the test suite work correctly with `trpl`, we must first
# build `trpl` itself (`mdbook` will not do it), and then explicitly pass
# its `deps` path as a library search path for `mdbook test`. That will make
# sure all the crates can be resolved when running the tests.
- name: Build `trpl` crate
run: |
cd packages/trpl
cargo build
- name: Run tests
run: mdbook test
run:
mdbook test --library-path packages/trpl/target/debug/deps
package_tests:
name: Run package tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Update rustup
run: rustup self update
- name: Install Rust
run: |
rustup set profile minimal
rustup toolchain install 1.82 -c rust-docs
rustup default 1.82
- name: Run `tools` package tests
run: |
cargo test
- name: Run `mdbook-trpl` package tests
working-directory: packages/mdbook-trpl
run: |
cargo test
lint:
name: Run lints
runs-on: ubuntu-latest
Expand All @@ -42,7 +72,9 @@ jobs:
run: |
mkdir bin
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
echo "$(pwd)/bin" >> ${GITHUB_PATH}
echo "$(pwd)/bin" >> "${GITHUB_PATH}"
- name: Install mdbook-trpl binaries
run: cargo install --path packages/mdbook-trpl
- name: Install aspell
run: sudo apt-get install aspell
- name: Install shellcheck
Expand All @@ -55,7 +87,7 @@ jobs:
aspell --version
shellcheck --version
- name: Shellcheck
run: find . -name '*.sh' | xargs shellcheck
run: find . -name '*.sh' -print0 | xargs -0 shellcheck
- name: Spellcheck
run: bash ci/spellcheck.sh list
- name: Lint for local file paths
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ book/
target
tmp

.nova
.vscode
.zed
4 changes: 2 additions & 2 deletions 2018-edition/src/ch17-00-oop.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
The 2018 edition of the book is no longer distributed with Rust's documentation.

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

If you have an internet connection, you can [find a copy distributed with
Rust
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch17-00-oop.html).
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch17-00-oop.html).
4 changes: 2 additions & 2 deletions 2018-edition/src/ch17-01-what-is-oo.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
The 2018 edition of the book is no longer distributed with Rust's documentation.

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

If you have an internet connection, you can [find a copy distributed with
Rust
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch17-01-what-is-oo.html).
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch17-01-what-is-oo.html).
4 changes: 2 additions & 2 deletions 2018-edition/src/ch17-02-trait-objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
The 2018 edition of the book is no longer distributed with Rust's documentation.

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

If you have an internet connection, you can [find a copy distributed with
Rust
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch17-02-trait-objects.html).
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch17-02-trait-objects.html).
4 changes: 2 additions & 2 deletions 2018-edition/src/ch17-03-oo-design-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
The 2018 edition of the book is no longer distributed with Rust's documentation.

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

If you have an internet connection, you can [find a copy distributed with
Rust
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch17-03-oo-design-patterns.html).
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch17-03-oo-design-patterns.html).
4 changes: 2 additions & 2 deletions 2018-edition/src/ch18-00-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
The 2018 edition of the book is no longer distributed with Rust's documentation.

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

If you have an internet connection, you can [find a copy distributed with
Rust
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch18-00-patterns.html).
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch18-00-patterns.html).
4 changes: 2 additions & 2 deletions 2018-edition/src/ch18-01-all-the-places-for-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
The 2018 edition of the book is no longer distributed with Rust's documentation.

If you came here via a link or web search, you may want to check out [the current
version of the book](../ch18-01-all-the-places-for-patterns.html) instead.
version of the book](../ch19-01-all-the-places-for-patterns.html) instead.

If you have an internet connection, you can [find a copy distributed with
Rust
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch18-01-all-the-places-for-patterns.html).
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch18-01-all-the-places-for-patterns.html).
4 changes: 2 additions & 2 deletions 2018-edition/src/ch18-02-refutability.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
The 2018 edition of the book is no longer distributed with Rust's documentation.

If you came here via a link or web search, you may want to check out [the current
version of the book](../ch18-02-refutability.html) instead.
version of the book](../ch19-02-refutability.html) instead.

If you have an internet connection, you can [find a copy distributed with
Rust
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch18-02-refutability.html).
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch18-02-refutability.html).
4 changes: 2 additions & 2 deletions 2018-edition/src/ch18-03-pattern-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
The 2018 edition of the book is no longer distributed with Rust's documentation.

If you came here via a link or web search, you may want to check out [the current
version of the book](../ch18-03-pattern-syntax.html) instead.
version of the book](../ch19-03-pattern-syntax.html) instead.

If you have an internet connection, you can [find a copy distributed with
Rust
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch18-03-pattern-syntax.html).
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch18-03-pattern-syntax.html).
4 changes: 2 additions & 2 deletions 2018-edition/src/ch19-00-advanced-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
The 2018 edition of the book is no longer distributed with Rust's documentation.

If you came here via a link or web search, you may want to check out [the current
version of the book](../ch19-00-advanced-features.html) instead.
version of the book](../ch20-00-advanced-features.html) instead.

If you have an internet connection, you can [find a copy distributed with
Rust
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch19-00-advanced-features.html).
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch19-00-advanced-features.html).
4 changes: 2 additions & 2 deletions 2018-edition/src/ch19-01-unsafe-rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
The 2018 edition of the book is no longer distributed with Rust's documentation.

If you came here via a link or web search, you may want to check out [the current
version of the book](../ch19-01-unsafe-rust.html) instead.
version of the book](../ch20-01-unsafe-rust.html) instead.

If you have an internet connection, you can [find a copy distributed with
Rust
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch19-01-unsafe-rust.html).
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch19-01-unsafe-rust.html).
4 changes: 2 additions & 2 deletions 2018-edition/src/ch19-03-advanced-traits.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
The 2018 edition of the book is no longer distributed with Rust's documentation.

If you came here via a link or web search, you may want to check out [the current
version of the book](../ch19-03-advanced-traits.html) instead.
version of the book](../ch20-03-advanced-traits.html) instead.

If you have an internet connection, you can [find a copy distributed with
Rust
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch19-03-advanced-traits.html).
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch19-03-advanced-traits.html).
4 changes: 2 additions & 2 deletions 2018-edition/src/ch19-04-advanced-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
The 2018 edition of the book is no longer distributed with Rust's documentation.

If you came here via a link or web search, you may want to check out [the current
version of the book](../ch19-04-advanced-types.html) instead.
version of the book](../ch20-04-advanced-types.html) instead.

If you have an internet connection, you can [find a copy distributed with
Rust
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch19-04-advanced-types.html).
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch19-04-advanced-types.html).
4 changes: 2 additions & 2 deletions 2018-edition/src/ch19-05-advanced-functions-and-closures.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
The 2018 edition of the book is no longer distributed with Rust's documentation.

If you came here via a link or web search, you may want to check out [the current
version of the book](../ch19-05-advanced-functions-and-closures.html) instead.
version of the book](../ch20-05-advanced-functions-and-closures.html) instead.

If you have an internet connection, you can [find a copy distributed with
Rust
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch19-05-advanced-functions-and-closures.html).
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch19-05-advanced-functions-and-closures.html).
4 changes: 2 additions & 2 deletions 2018-edition/src/ch19-06-macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
The 2018 edition of the book is no longer distributed with Rust's documentation.

If you came here via a link or web search, you may want to check out [the current
version of the book](../ch19-06-macros.html) instead.
version of the book](../ch20-06-macros.html) instead.

If you have an internet connection, you can [find a copy distributed with
Rust
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch19-06-macros.html).
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch19-06-macros.html).
4 changes: 2 additions & 2 deletions 2018-edition/src/ch20-00-final-project-a-web-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
The 2018 edition of the book is no longer distributed with Rust's documentation.

If you came here via a link or web search, you may want to check out [the current
version of the book](../ch20-00-final-project-a-web-server.html) instead.
version of the book](../ch21-00-final-project-a-web-server.html) instead.

If you have an internet connection, you can [find a copy distributed with
Rust
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch20-00-final-project-a-web-server.html).
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch20-00-final-project-a-web-server.html).
4 changes: 2 additions & 2 deletions 2018-edition/src/ch20-01-single-threaded.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
The 2018 edition of the book is no longer distributed with Rust's documentation.

If you came here via a link or web search, you may want to check out [the current
version of the book](../ch20-01-single-threaded.html) instead.
version of the book](../ch21-01-single-threaded.html) instead.

If you have an internet connection, you can [find a copy distributed with
Rust
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch20-01-single-threaded.html).
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch20-01-single-threaded.html).
4 changes: 2 additions & 2 deletions 2018-edition/src/ch20-02-multithreaded.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
The 2018 edition of the book is no longer distributed with Rust's documentation.

If you came here via a link or web search, you may want to check out [the current
version of the book](../ch20-02-multithreaded.html) instead.
version of the book](../ch21-02-multithreaded.html) instead.

If you have an internet connection, you can [find a copy distributed with
Rust
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch20-02-multithreaded.html).
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch20-02-multithreaded.html).
4 changes: 2 additions & 2 deletions 2018-edition/src/ch20-03-graceful-shutdown-and-cleanup.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
The 2018 edition of the book is no longer distributed with Rust's documentation.

If you came here via a link or web search, you may want to check out [the current
version of the book](../ch20-03-graceful-shutdown-and-cleanup.html) instead.
version of the book](../ch21-03-graceful-shutdown-and-cleanup.html) instead.

If you have an internet connection, you can [find a copy distributed with
Rust
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch20-03-graceful-shutdown-and-cleanup.html).
1.30](https://doc.rust-lang.org/1.30.0/book/2018-edition/ch20-03-graceful-shutdown-and-cleanup.html).
Loading

0 comments on commit 3c4873b

Please sign in to comment.