mirror of
https://github.com/rust-lang/rustlings.git
synced 2024-12-25 23:10:30 +00:00
Merge pull request #1112 from tvkn/feat/options1/update-expected-result
feat(options1): update expected result
This commit is contained in:
commit
affc815447
1 changed files with 4 additions and 2 deletions
|
@ -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.
|
||||
???
|
||||
}
|
||||
|
||||
|
@ -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]
|
||||
|
|
Loading…
Reference in a new issue