docs: cleanup the explanation paragraphs at the start of each exercise.

This commit is contained in:
Robert Fry
2023-05-29 18:39:08 +01:00
parent 30291a3c25
commit 7eef5d15ee
95 changed files with 577 additions and 337 deletions

View File

@@ -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);
}

View File

@@ -1,5 +1,7 @@
// options2.rs
// Execute `rustlings hint options2` or use the `hint` watch subcommand for a hint.
//
// Execute `rustlings hint options2` or use the `hint` watch subcommand for a
// hint.
// I AM NOT DONE
@@ -27,8 +29,9 @@ mod tests {
let mut cursor = range;
// TODO: make this a while let statement - remember that vector.pop also adds another layer of Option<T>
// You can stack `Option<T>`s into while let and if let
// TODO: make this a while let statement - remember that vector.pop also
// adds another layer of Option<T>. You can stack `Option<T>`s into
// while let and if let.
integer = optional_integers.pop() {
assert_eq!(integer, cursor);
cursor -= 1;

View File

@@ -1,5 +1,7 @@
// options3.rs
// Execute `rustlings hint options3` or use the `hint` watch subcommand for a hint.
//
// Execute `rustlings hint options3` or use the `hint` watch subcommand for a
// hint.
// I AM NOT DONE