Skip to content

Commit 7442728

Browse files
committed
Remove unnecessary block in awkward match
1 parent 5b1e946 commit 7442728

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)