mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-22 05:52:23 -05:00
fix: rename option to options
This commit is contained in:
parent
472d7944f9
commit
b644558c19
5 changed files with 47 additions and 47 deletions
|
@ -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:
|
|
@ -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
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
// option2.rs
|
||||
// options2.rs
|
||||
// Make me compile! Execute `rustlings hint option2` for hints
|
||||
|
||||
// I AM NOT DONE
|
|
@ -1,4 +1,4 @@
|
|||
// option3.rs
|
||||
// options3.rs
|
||||
// Make me compile! Execute `rustlings hint option3` for hints
|
||||
|
||||
// I AM NOT DONE
|
84
info.toml
84
info.toml
|
@ -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]]
|
||||
|
|
Loading…
Reference in a new issue