Skip to content

Commit 1a4f55e

Browse files
authored
Merge pull request #1933 from loshz/main
options1: slightly update grammar
2 parents 9691c3c + 30273a6 commit 1a4f55e

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
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

src/verify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ fn prompt_for_completion(
196196
if no_emoji {
197197
println!("\n~*~ {success_msg} ~*~\n");
198198
} else {
199-
println!("\n🎉 🎉 {success_msg} 🎉 🎉\n");
199+
println!("\n🎉 🎉 {success_msg} 🎉 🎉\n");
200200
}
201201

202202
if let Some(output) = prompt_output {

0 commit comments

Comments
 (0)