Browse Source

update original

pull/1344/merge
funkill2 1 month ago
parent
commit
019a90a5d5
  1. 2
      rustbook-en/src/SUMMARY.md
  2. 2
      rustbook-en/src/ch06-03-if-let.md
  3. 2
      rustbook-en/src/ch17-02-concurrency-with-async.md
  4. 2
      rustbook-en/src/ch19-02-refutability.md

2
rustbook-en/src/SUMMARY.md

@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
- [Enums and Pattern Matching](ch06-00-enums.md)
- [Defining an Enum](ch06-01-defining-an-enum.md)
- [The `match` Control Flow Construct](ch06-02-match.md)
- [Concise Control Flow with `if let` and `let else`](ch06-03-if-let.md)
- [Concise Control Flow with `if let` and `let...else`](ch06-03-if-let.md)
- [Packages, Crates, and Modules](ch07-00-managing-growing-projects-with-packages-crates-and-modules.md)
- [Packages and Crates](ch07-01-packages-and-crates.md)

2
rustbook-en/src/ch06-03-if-let.md

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
## Concise Control Flow with `if let` and `let else`
## Concise Control Flow with `if let` and `let...else`
The `if let` syntax lets you combine `if` and `let` into a less verbose way to
handle values that match one pattern while ignoring the rest. Consider the

2
rustbook-en/src/ch17-02-concurrency-with-async.md

@ -255,7 +255,7 @@ synchronous channel. Rust doesn’t yet have a way to use a `for` loop with an @@ -255,7 +255,7 @@ synchronous channel. Rust doesn’t yet have a way to use a `for` loop with an
_asynchronously produced_ series of items, however, so we need to use a loop we
haven’t seen before: the `while let` conditional loop. This is the loop version
of the `if let` construct we saw back in the [“Concise Control Flow with `if
let` and `let else`”][if-let]<!-- ignore --> section in Chapter 6. The loop
let` and `let...else`”][if-let]<!-- ignore --> section in Chapter 6. The loop
will continue executing as long as the pattern it specifies continues to match
the value.

2
rustbook-en/src/ch19-02-refutability.md

@ -50,7 +50,7 @@ pattern `Some(x)`, Rust rightfully produces a compiler error. @@ -50,7 +50,7 @@ pattern `Some(x)`, Rust rightfully produces a compiler error.
If we have a refutable pattern where an irrefutable pattern is needed, we can
fix it by changing the code that uses the pattern: Instead of using `let`, we
can use `let else`. Then, if the pattern doesn’t match, the code in the curly
can use `let...else`. Then, if the pattern doesn’t match, the code in the curly
brackets will handle the value. Listing 19-9 shows how to fix the code in
Listing 19-8.

Loading…
Cancel
Save