Skip to content

Commit 8e5e4ae

Browse files
authored
Merge pull request #3893 from rust-lang/push-zwrsqqxunozz
Ch. 18: further clarify about irrefutable patterns
2 parents 976b2d8 + 0b869ee commit 8e5e4ae

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ch18-02-refutability.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ the code in the curly brackets, giving it a way to continue validly. Listing
6060
<span class="caption">Listing 18-9: Using `if let` and a block with refutable
6161
patterns instead of `let`</span>
6262

63-
We’ve given the code an out! This code is perfectly valid, although it means we
64-
cannot use an irrefutable pattern without receiving a warning. If we give `if
65-
let` a pattern that will always match, such as `x`, as shown in Listing 18-10,
66-
the compiler will give a warning.
63+
We’ve given the code an out! This code is perfectly valid now. However,
64+
if we give `if let` an irrefutable pattern (a pattern that will always
65+
match), such as `x`, as shown in Listing 18-10, the compiler will give a
66+
warning.
6767

6868
```rust
6969
{{#rustdoc_include ../listings/ch18-patterns-and-matching/listing-18-10/src/main.rs:here}}

0 commit comments

Comments
 (0)