diff options
| author | mokou <mokou@fastmail.com> | 2022-07-14 17:34:50 +0200 |
|---|---|---|
| committer | mokou <mokou@fastmail.com> | 2022-07-14 17:34:50 +0200 |
| commit | b644558c19dd1f0319204f50c1c162562edb79b1 (patch) | |
| tree | b87116c2bdf6071d0e1707137a82e94bb2d4231a | |
| parent | 472d7944f95e41d8fa9f78ac2870a3827afdc544 (diff) | |
fix: rename option to options
| -rw-r--r-- | exercises/options/README.md (renamed from exercises/option/README.md) | 2 | ||||
| -rw-r--r-- | exercises/options/options1.rs (renamed from exercises/option/option1.rs) | 4 | ||||
| -rw-r--r-- | exercises/options/options2.rs (renamed from exercises/option/option2.rs) | 2 | ||||
| -rw-r--r-- | exercises/options/options3.rs (renamed from exercises/option/option3.rs) | 2 | ||||
| -rw-r--r-- | info.toml | 84 |
5 files changed, 47 insertions, 47 deletions
diff --git a/exercises/option/README.md b/exercises/options/README.md index 89c0028..6140a16 100644 --- a/exercises/option/README.md +++ b/exercises/options/README.md @@ -1,4 +1,4 @@ -# Option +# Options Type Option represents an optional value: every Option is either Some and contains a value, or None, and does not. Option types are very common in Rust code, as they have a number of uses: diff --git a/exercises/option/option1.rs b/exercises/options/options1.rs index 17cf4f6..9d96817 100644 --- a/exercises/option/option1.rs +++ b/exercises/options/options1.rs @@ -1,5 +1,5 @@ -// option1.rs -// Make me compile! Execute `rustlings hint option1` for hints +// options1.rs +// Execute `rustlings hint options1` or use the `hint` watch subcommand for a hint. // I AM NOT DONE diff --git a/exercises/option/option2.rs b/exercises/options/options2.rs index c6b83ec..a1c21d3 100644 --- a/exercises/option/option2.rs +++ b/exercises/options/options2.rs @@ -1,4 +1,4 @@ -// option2.rs +// options2.rs // Make me compile! Execute `rustlings hint option2` for hints // I AM NOT DONE diff --git a/exercises/option/option3.rs b/exercises/options/options3.rs index 045d2ac..4cba4ad 100644 --- a/exercises/option/option3.rs +++ b/exercises/options/options3.rs @@ -1,4 +1,4 @@ -// option3.rs +// options3.rs // Make me compile! Execute `rustlings hint option3` for hints // I AM NOT DONE @@ -531,6 +531,48 @@ path = "exercises/quiz2.rs" mode = "test" hint = "No hints this time ;)" +# OPTIONS + +[[exercises]] +name = "options1" +path = "exercises/options/options1.rs" +mode = "compile" +hint = """ +Hint 1: Check out some functions of Option: +is_some +is_none +unwrap + +and: +pattern matching + +Hint 2: There are no sensible defaults for the value of an Array; the values need to be filled before use. +""" + +[[exercises]] +name = "options2" +path = "exercises/options/options2.rs" +mode = "compile" +hint = """ +check out: +https://doc.rust-lang.org/rust-by-example/flow_control/if_let.html +https://doc.rust-lang.org/rust-by-example/flow_control/while_let.html + +Remember that Options can be stacked in if let and while let. +For example: Some(Some(variable)) = variable2 +Also see Option::flatten +""" + +[[exercises]] +name = "options3" +path = "exercises/options/options3.rs" +mode = "compile" +hint = """ +The compiler says a partial move happened in the `match` +statement. How can this be avoided? The compiler shows the correction +needed. After making the correction as suggested by the compiler, do +read: https://doc.rust-lang.org/std/keyword.ref.html""" + # ERROR HANDLING [[exercises]] @@ -661,48 +703,6 @@ ReportCard struct generic, but also the correct property - you will need to chan of the struct slightly too...you can do it! """ -# OPTIONS - -[[exercises]] -name = "option1" -path = "exercises/option/option1.rs" -mode = "compile" -hint = """ -Hint 1: Check out some functions of Option: -is_some -is_none -unwrap - -and: -pattern matching - -Hint 2: There are no sensible defaults for the value of an Array; the values need to be filled before use. -""" - -[[exercises]] -name = "option2" -path = "exercises/option/option2.rs" -mode = "compile" -hint = """ -check out: -https://doc.rust-lang.org/rust-by-example/flow_control/if_let.html -https://doc.rust-lang.org/rust-by-example/flow_control/while_let.html - -Remember that Options can be stacked in if let and while let. -For example: Some(Some(variable)) = variable2 -Also see Option::flatten -""" - -[[exercises]] -name = "option3" -path = "exercises/option/option3.rs" -mode = "compile" -hint = """ -The compiler says a partial move happened in the `match` -statement. How can this be avoided? The compiler shows the correction -needed. After making the correction as suggested by the compiler, do -read: https://doc.rust-lang.org/std/keyword.ref.html""" - # TRAITS [[exercises]] |
