Skip to content

Commit 09db1e5

Browse files
committed
Minor corrections
Irrefutable pattern receives warning, refutable error, when used unexpectedly.
1 parent f1e5ad8 commit 09db1e5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/ch18-02-refutability.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ the code in the curly brackets, giving it a way to continue validly. Listing
6161
patterns instead of `let`</span>
6262

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

@@ -83,7 +83,7 @@ For this reason, match arms must use refutable patterns, except for the last
8383
arm, which should match any remaining values with an irrefutable pattern. Rust
8484
allows us to use an irrefutable pattern in a `match` with only one arm, but
8585
this syntax isn’t particularly useful and could be replaced with a simpler
86-
`let` statement.
86+
`if let` statement.
8787

8888
Now that you know where to use patterns and the difference between refutable
8989
and irrefutable patterns, let’s cover all the syntax we can use to create

0 commit comments

Comments
 (0)