Skip to content

Commit f2833c5

Browse files
committed
options1: Update wording & fix grammar
Signed-off-by: Dan Bond <danbond@protonmail.com>
1 parent 9c6f56b commit f2833c5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

exercises/12_options/options1.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
// I AM NOT DONE
77

88
// This function returns how much icecream there is left in the fridge.
9-
// If it's before 10PM, there's 5 pieces left. At 10PM, someone eats them
9+
// If it's before 10PM, there's 5 scoops left. At 10PM, someone eats it
1010
// all, so there'll be no more left :(
1111
fn maybe_icecream(time_of_day: u16) -> Option<u16> {
1212
// We use the 24-hour system here, so 10PM is a value of 22 and 12AM is a
13-
// value of 0 The Option output should gracefully handle cases where
13+
// value of 0. The Option output should gracefully handle cases where
1414
// time_of_day > 23.
1515
// TODO: Complete the function body - remember to return an Option!
1616
???
@@ -22,10 +22,11 @@ mod tests {
2222

2323
#[test]
2424
fn check_icecream() {
25+
assert_eq!(maybe_icecream(0), Some(5));
2526
assert_eq!(maybe_icecream(9), Some(5));
26-
assert_eq!(maybe_icecream(10), Some(5));
27-
assert_eq!(maybe_icecream(23), Some(0));
27+
assert_eq!(maybe_icecream(18), Some(5));
2828
assert_eq!(maybe_icecream(22), Some(0));
29+
assert_eq!(maybe_icecream(23), Some(0));
2930
assert_eq!(maybe_icecream(25), None);
3031
}
3132

0 commit comments

Comments
 (0)