Rollup merge of #31145 - D101101:patch-1, r=steveklabnik
r? @steveklabnik
This commit is contained in:
commit
4d99bad158
1 changed files with 1 additions and 0 deletions
|
@ -908,6 +908,7 @@ let guess: u32 = match guess.trim().parse() {
|
|||
```
|
||||
|
||||
This is how you generally move from ‘crash on error’ to ‘actually handle the
|
||||
error’, by switching from `expect()` to a `match` statement. The `Result`
|
||||
returned by `parse()` is an `enum` like `Ordering`, but in this case, each
|
||||
variant has some data associated with it: `Ok` is a success, and `Err` is a
|
||||
failure. Each contains more information: the successfully parsed integer, or an
|
||||
|
|
Loading…
Add table
Reference in a new issue