Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
16 changes: 9 additions & 7 deletions src/ch02-00-guessing-game-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ which will ignore the _Cargo.lock_ file and figure out all the latest versions
that fit your specifications in _Cargo.toml_. Cargo will then write those
versions to the _Cargo.lock_ file. Otherwise, by default, Cargo will only look
for versions greater than 0.8.5 and less than 0.9.0. If the `rand` crate has
released the two new versions 0.8.6 and 0.9.0, you would see the following if
released the two new versions 0.8.6 and 0.999.0, you would see the following if
you ran `cargo update`:

<!-- manual-regeneration
Expand All @@ -491,17 +491,19 @@ as a guide to creating the hypothetical output shown here -->
$ cargo update
Updating crates.io index
Locking 1 package to latest Rust 1.85.0 compatible version
Updating rand v0.8.5 -> v0.8.6 (available: v0.9.0)
Updating rand v0.8.5 -> v0.8.6 (available: v0.999.0)
```

Cargo ignores the 0.9.0 release. At this point, you would also notice a change
in your _Cargo.lock_ file noting that the version of the `rand` crate you are
now using is 0.8.6. To use `rand` version 0.9.0 or any version in the 0.9._x_
series, you’d have to update the _Cargo.toml_ file to look like this instead:
Cargo ignores the 0.999.0 release. At this point, you would also notice a
change in your _Cargo.lock_ file noting that the version of the `rand` crate
you are now using is 0.8.6. To use `rand` version 0.999.0 or any version in the
0.999._x_ series, you’d have to update the _Cargo.toml_ file to look like this
instead (don’t actually make this change because the following examples assume
you’re using `rand` 0.8):

```toml
[dependencies]
rand = "0.9.0"
rand = "0.999.0"
```

The next time you run `cargo build`, Cargo will update the registry of crates
Expand Down
2 changes: 1 addition & 1 deletion src/ch06-03-if-let.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/ch17-02-concurrency-with-async.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion src/ch17-03-more-futures.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ blocking.
In Listing 17-15, we use `slow` to emulate doing this kind of CPU-bound work in
a pair of futures.

<Listing number="17-15" caption="Calling `slow` to simulate running slow operations" file-name="src/main.rs">
<Listing number="17-15" caption="Calling the `slow` function to simulate slow operations" file-name="src/main.rs">

```rust
{{#rustdoc_include ../listings/ch17-async-await/listing-17-15/src/main.rs:slow-futures}}
Expand Down
2 changes: 1 addition & 1 deletion src/ch19-02-refutability.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion src/ch19-03-pattern-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ In this example, the value `p` matches the second arm by virtue of `x`
containing a `0`, so this code will print `On the y axis at 7`.

Remember that a `match` expression stops checking arms once it has found the
first matching pattern, so even though `Point { x: 0, y: 0}` is on the `x` axis
first matching pattern, so even though `Point { x: 0, y: 0 }` is on the `x` axis
and the `y` axis, this code would only print `On the x axis at 0`.

<!-- Old headings. Do not remove or links may break. -->
Expand Down