summaryrefslogtreecommitdiff
path: root/exercises/options/options1.rs
diff options
context:
space:
mode:
authortajo48 <55502906+tajo48@users.noreply.github.com>2023-06-15 00:46:45 +0200
committerGitHub <noreply@github.com>2023-06-15 00:46:45 +0200
commite1704a2f1bd2e1c92e0741d656228fe6ccf36a35 (patch)
tree6bbd1dd1ea127dd652e0fe64093c10a78734fdf5 /exercises/options/options1.rs
parent1e02f194fdd1cb1ca99cf1d93d11455db8b1bce6 (diff)
parent0282da6881c0708b5aaf6a01e731b88b61201f71 (diff)
Merge branch 'main' into main
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);
}