From 7442728c9c3c4378603625b03fd1ca7fd4315c0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gutyina=20Gerg=C5=91?= Date: Wed, 5 Jul 2023 13:53:26 +0200 Subject: [PATCH] Remove unnecessary block in awkward match --- src/flow_control/if_let.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/flow_control/if_let.md b/src/flow_control/if_let.md index 3742b6f683..89367924b7 100644 --- a/src/flow_control/if_let.md +++ b/src/flow_control/if_let.md @@ -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?