diff options
| author | Ufuk Celebi <uce@users.noreply.github.com> | 2020-04-15 23:52:31 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-15 23:52:31 +0200 |
| commit | 6c3cc2caf54d557aaa522baebb3a5bfabc450576 (patch) | |
| tree | 135f8ab7517f154dd4d782519d1d6885b2fa3d65 /exercises/error_handling | |
| parent | 5999acd24a4f203292be36e0fd18d385887ec481 (diff) | |
chore: delete orphaned `error_handling/option1.rs`
`error_handling/option1.rs` has been replaced by `option/option1.rs` and
is not referenced in `info.toml` any more.
Diffstat (limited to 'exercises/error_handling')
| -rw-r--r-- | exercises/error_handling/option1.rs | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/exercises/error_handling/option1.rs b/exercises/error_handling/option1.rs deleted file mode 100644 index 5d81b15..0000000 --- a/exercises/error_handling/option1.rs +++ /dev/null @@ -1,31 +0,0 @@ -// option1.rs -// 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`! -// Execute `rustlings hint option1` for hints :) - -// I AM NOT DONE - -pub fn pop_too_much() -> bool { - let mut list = vec![3]; - - let last = list.pop().unwrap(); - println!("The last item in the list is {:?}", last); - - let second_to_last = list.pop().unwrap(); - println!( - "The second-to-last item in the list is {:?}", - second_to_last - ); - true -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn should_not_panic() { - assert!(pop_too_much()); - } -} |
