File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 6
6
// I AM NOT DONE
7
7
8
8
// 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
10
10
// all, so there'll be no more left :(
11
11
fn maybe_icecream ( time_of_day : u16 ) -> Option < u16 > {
12
12
// 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
14
14
// time_of_day > 23.
15
15
// TODO: Complete the function body - remember to return an Option!
16
16
???
@@ -22,10 +22,11 @@ mod tests {
22
22
23
23
#[ test]
24
24
fn check_icecream ( ) {
25
+ assert_eq ! ( maybe_icecream( 0 ) , Some ( 5 ) ) ;
25
26
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 ) ) ;
28
28
assert_eq ! ( maybe_icecream( 22 ) , Some ( 0 ) ) ;
29
+ assert_eq ! ( maybe_icecream( 23 ) , Some ( 0 ) ) ;
29
30
assert_eq ! ( maybe_icecream( 25 ) , None ) ;
30
31
}
31
32
You can’t perform that action at this time.
0 commit comments