Skip to content

Commit 330e7a8

Browse files
authored
Merge pull request #1659 from chuanqisun/patch-1
Fix sample code mismatching its comments
2 parents 06cf778 + 5561d7e commit 330e7a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/error/option_unwrap/defaults.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ fn main() {
9494
};
9595
let first_available_fruit = my_fruit
9696
.get_or_insert_with(get_lemon_as_fallback);
97-
println!("my_fruit is: {:?}", first_available_fruit);
9897
println!("first_available_fruit is: {:?}", first_available_fruit);
98+
println!("my_fruit is: {:?}", my_fruit);
9999
// Providing lemon as fallback
100-
// my_fruit is: Lemon
101100
// first_available_fruit is: Lemon
101+
// my_fruit is: Some(Lemon)
102102
103103
// If the Option has a value, it is left unchanged, and the closure is not invoked
104104
let mut my_apple = Some(Fruit::Apple);

0 commit comments

Comments
 (0)