summaryrefslogtreecommitdiff
path: root/exercises/options/options1.rs
diff options
context:
space:
mode:
Diffstat (limited to 'exercises/options/options1.rs')
-rw-r--r--exercises/options/options1.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/exercises/options/options1.rs b/exercises/options/options1.rs
index 1f891b0..e131b48 100644
--- a/exercises/options/options1.rs
+++ b/exercises/options/options1.rs
@@ -1,5 +1,7 @@
// options1.rs
-// Execute `rustlings hint options1` or use the `hint` watch subcommand for a hint.
+//
+// Execute `rustlings hint options1` or use the `hint` watch subcommand for a
+// hint.
// I AM NOT DONE
@@ -7,8 +9,9 @@
// If it's before 10PM, there's 5 pieces left. At 10PM, someone eats them
// all, so there'll be no more left :(
fn maybe_icecream(time_of_day: u16) -> Option<u16> {
- // We use the 24-hour system here, so 10PM is a value of 22 and 12AM is a value of 0
- // The Option output should gracefully handle cases where time_of_day > 23.
+ // We use the 24-hour system here, so 10PM is a value of 22 and 12AM is a
+ // value of 0 The Option output should gracefully handle cases where
+ // time_of_day > 23.
// TODO: Complete the function body - remember to return an Option!
???
}
@@ -28,7 +31,8 @@ mod tests {
#[test]
fn raw_value() {
- // TODO: Fix this test. How do you get at the value contained in the Option?
+ // TODO: Fix this test. How do you get at the value contained in the
+ // Option?
let icecreams = maybe_icecream(12);
assert_eq!(icecreams, 5);
}