Skip to content

Commit

Permalink
Merge pull request #1725 from gepbird/remove-awkward-match
Browse files Browse the repository at this point in the history
Remove awkward match in if_let
  • Loading branch information
marioidival authored Jun 30, 2024
2 parents e6d32ac + 7442728 commit 658c6c2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/flow_control/if_let.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ For some use cases, when matching enums, `match` is awkward. For example:
let optional = Some(7);

match optional {
Some(i) => {
println!("This is a really long string and `{:?}`", i);
// ^ Needed 2 indentations just so we could destructure
// `i` from the option.
},
Some(i) => println!("This is a really long string and `{:?}`", i),
_ => {},
// ^ Required because `match` is exhaustive. Doesn't it seem
// like wasted space?
Expand Down

0 comments on commit 658c6c2

Please sign in to comment.