diff options
Diffstat (limited to 'docs/user/assists.md')
-rw-r--r-- | docs/user/assists.md | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/user/assists.md b/docs/user/assists.md index 5a83c4a98..ee515949e 100644 --- a/docs/user/assists.md +++ b/docs/user/assists.md | |||
@@ -697,3 +697,21 @@ use std::┃collections::HashMap; | |||
697 | // AFTER | 697 | // AFTER |
698 | use std::{collections::HashMap}; | 698 | use std::{collections::HashMap}; |
699 | ``` | 699 | ``` |
700 | |||
701 | ## `unwrap_block` | ||
702 | |||
703 | This assist removes if...else, for, while and loop control statements to just keep the body. | ||
704 | |||
705 | ```rust | ||
706 | // BEFORE | ||
707 | fn foo() { | ||
708 | if true {┃ | ||
709 | println!("foo"); | ||
710 | } | ||
711 | } | ||
712 | |||
713 | // AFTER | ||
714 | fn foo() { | ||
715 | println!("foo"); | ||
716 | } | ||
717 | ``` | ||