Skip to content

Commit

Permalink
Rollup merge of rust-lang#25242 - acgtyrant:patch-3, r=Manishearth
Browse files Browse the repository at this point in the history
Fix a typo while `io::stdin().read_line()` returns `Result` actually
  • Loading branch information
Manishearth committed May 10, 2015
2 parents c145cda + fa3fd81 commit 6504247
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/doc/trpl/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ we can use the `unwrap()` method:
io::stdin().read_line(&mut buffer).unwrap();
```

`unwrap()` will `panic!` if the `Option` is `None`. This basically says "Give
`unwrap()` will `panic!` if the `Result` is `Err`. This basically says "Give
me the value, and if something goes wrong, just crash." This is less reliable
than matching the error and attempting to recover, but is also significantly
shorter. Sometimes, just crashing is appropriate.
Expand Down

0 comments on commit 6504247

Please sign in to comment.