Skip to content

Commit 658c6c2

Browse files
authored
Merge pull request #1725 from gepbird/remove-awkward-match
Remove awkward match in if_let
2 parents e6d32ac + 7442728 commit 658c6c2

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/flow_control/if_let.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ For some use cases, when matching enums, `match` is awkward. For example:
77
let optional = Some(7);
88

99
match optional {
10-
Some(i) => {
11-
println!("This is a really long string and `{:?}`", i);
12-
// ^ Needed 2 indentations just so we could destructure
13-
// `i` from the option.
14-
},
10+
Some(i) => println!("This is a really long string and `{:?}`", i),
1511
_ => {},
1612
// ^ Required because `match` is exhaustive. Doesn't it seem
1713
// like wasted space?

0 commit comments

Comments
 (0)