Skip to content

Commit

Permalink
Merge pull request rust-lang#1112 from tvkn/feat/options1/update-expe…
Browse files Browse the repository at this point in the history
…cted-result

feat(options1): update expected result
  • Loading branch information
shadows-withal authored Aug 3, 2022
2 parents af301a2 + a56f648 commit affc815
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions exercises/options/options1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ fn print_number(maybe_number: Option<u16>) {
// TODO: Return an Option!
fn maybe_icecream(time_of_day: u16) -> Option<u16> {
// We use the 24-hour system here, so 10PM is a value of 22
// The Option output should gracefully handle cases where time_of_day > 24.
???
}

Expand All @@ -24,8 +25,9 @@ mod tests {
#[test]
fn check_icecream() {
assert_eq!(maybe_icecream(10), Some(5));
assert_eq!(maybe_icecream(23), None);
assert_eq!(maybe_icecream(22), None);
assert_eq!(maybe_icecream(23), Some(0));
assert_eq!(maybe_icecream(22), Some(0));
assert_eq!(maybe_icecream(25), None);
}

#[test]
Expand Down

0 comments on commit affc815

Please sign in to comment.