diff options
Diffstat (limited to 'exercises/error_handling/errors2.rs')
| -rw-r--r-- | exercises/error_handling/errors2.rs | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/exercises/error_handling/errors2.rs b/exercises/error_handling/errors2.rs index 315528f..aad3a93 100644 --- a/exercises/error_handling/errors2.rs +++ b/exercises/error_handling/errors2.rs @@ -14,7 +14,7 @@ // and add. // There are at least two ways to implement this that are both correct-- but -// one is a lot shorter! Scroll down for hints to both ways. +// one is a lot shorter! Execute `rustlings hint errors2` for hints to both ways. // I AM NOT DONE @@ -45,27 +45,3 @@ mod tests { ); } } - - - - - - - - - - - - - - - - - -// One way to handle this is using a `match` statement on -// `item_quantity.parse::<i32>()` where the cases are `Ok(something)` and -// `Err(something)`. This pattern is very common in Rust, though, so there's -// a `?` operator that does pretty much what you would make that match statement -// do for you! Take a look at this section of the Error Handling chapter: -// https://doc.rust-lang.org/book/ch09-02-recoverable-errors-with-result.html#a-shortcut-for-propagating-errors-the--operator -// and give it a try! |
