diff options
| author | marisa <mokou@posteo.de> | 2019-11-11 16:51:38 +0100 |
|---|---|---|
| committer | marisa <mokou@posteo.de> | 2019-11-11 16:51:38 +0100 |
| commit | 9bdb0a12e45a8e9f9f6a4bd4a9c172c5376c7f60 (patch) | |
| tree | 3c4a094d57ecedf9706e0ba567a9f157590177c8 /exercises/error_handling/option1.rs | |
| parent | 627cdc07d07dfe6a740e885e0ddf6900e7ec336b (diff) | |
feat: Refactor hint system
Hints are now accessible using the CLI subcommand `rustlings hint
<exercise name`.
BREAKING CHANGE: This fundamentally changes the way people interact with exercises.
Diffstat (limited to 'exercises/error_handling/option1.rs')
| -rw-r--r-- | exercises/error_handling/option1.rs | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/exercises/error_handling/option1.rs b/exercises/error_handling/option1.rs index c5a4a64..e334e93 100644 --- a/exercises/error_handling/option1.rs +++ b/exercises/error_handling/option1.rs @@ -2,7 +2,7 @@ // This example panics because the second time it calls `pop`, the `vec` // is empty, so `pop` returns `None`, and `unwrap` panics if it's called // on `None`. Handle this in a more graceful way than calling `unwrap`! -// Scroll down for hints :) +// Execute `rustlings hint option1` for hints :) pub fn pop_too_much() -> bool { let mut list = vec![3]; @@ -27,31 +27,3 @@ mod tests { assert!(pop_too_much()); } } - - - - - - - - - - - - - - - - - - - - - - - -// Try using a `match` statement where the arms are `Some(thing)` and `None`. -// Or set a default value to print out if you get `None` by using the -// function `unwrap_or`. -// Or use an `if let` statement on the result of `pop()` to both destructure -// a `Some` value and only print out something if we have a value! |
