mirror of
https://github.com/rust-lang/rustlings.git
synced 2024-12-26 00:00:03 +03:00
feat(options): add hint comments
This commit is contained in:
parent
06e4fd3765
commit
b71feed824
|
@ -1,5 +1,5 @@
|
||||||
// options2.rs
|
// options2.rs
|
||||||
// Make me compile! Execute `rustlings hint option2` for hints
|
// Execute `rustlings hint options2` or use the `hint` watch subcommand for a hint.
|
||||||
|
|
||||||
// I AM NOT DONE
|
// I AM NOT DONE
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// options3.rs
|
// options3.rs
|
||||||
// Make me compile! Execute `rustlings hint option3` for hints
|
// Execute `rustlings hint options3` or use the `hint` watch subcommand for a hint.
|
||||||
|
|
||||||
// I AM NOT DONE
|
// I AM NOT DONE
|
||||||
|
|
||||||
|
|
15
info.toml
15
info.toml
|
@ -536,18 +536,11 @@ hint = "No hints this time ;)"
|
||||||
[[exercises]]
|
[[exercises]]
|
||||||
name = "options1"
|
name = "options1"
|
||||||
path = "exercises/options/options1.rs"
|
path = "exercises/options/options1.rs"
|
||||||
mode = "compile"
|
mode = "test"
|
||||||
hint = """
|
hint = """
|
||||||
Hint 1: Check out some functions of Option:
|
Options can have a Some value, with an inner value, or a None value, without an inner value.
|
||||||
is_some
|
There's multiple ways to get at the inner value, you can use unwrap, or pattern match. Unwrapping
|
||||||
is_none
|
is the easiest, but how do you do it safely so that it doesn't panic in your face later?"""
|
||||||
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]]
|
[[exercises]]
|
||||||
name = "options2"
|
name = "options2"
|
||||||
|
|
Loading…
Reference in a new issue