fix(option2): Add TODO to comments (#400)
This commit is contained in:
parent
763aa6e378
commit
10967bce57
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let optional_value = Some(String::from("rustlings"));
|
let optional_value = Some(String::from("rustlings"));
|
||||||
// Make this an if let statement whose value is "Some" type
|
// TODO: Make this an if let statement whose value is "Some" type
|
||||||
value = optional_value {
|
value = optional_value {
|
||||||
println!("the value of optional value is: {}", value);
|
println!("the value of optional value is: {}", value);
|
||||||
} else {
|
} else {
|
||||||
@ -17,7 +17,7 @@ fn main() {
|
|||||||
optional_values_vec.push(Some(x));
|
optional_values_vec.push(Some(x));
|
||||||
}
|
}
|
||||||
|
|
||||||
// make this a while let statement - remember that vector.pop also adds another layer of Option<T>
|
// 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
|
// You can stack `Option<T>`'s into while let and if let
|
||||||
value = optional_values_vec.pop() {
|
value = optional_values_vec.pop() {
|
||||||
println!("current value: {}", value);
|
println!("current value: {}", value);
|
||||||
|
Loading…
Reference in New Issue
Block a user