aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/user/assists.md22
1 files changed, 21 insertions, 1 deletions
diff --git a/docs/user/assists.md b/docs/user/assists.md
index 6c6943622..ee515949e 100644
--- a/docs/user/assists.md
+++ b/docs/user/assists.md
@@ -175,7 +175,9 @@ trait Trait<T> {
175} 175}
176 176
177impl Trait<u32> for () { 177impl Trait<u32> for () {
178 fn foo(&self) -> u32 { todo!() } 178 fn foo(&self) -> u32 {
179 todo!()
180 }
179 181
180} 182}
181``` 183```
@@ -695,3 +697,21 @@ use std::┃collections::HashMap;
695// AFTER 697// AFTER
696use std::{collections::HashMap}; 698use std::{collections::HashMap};
697``` 699```
700
701## `unwrap_block`
702
703This assist removes if...else, for, while and loop control statements to just keep the body.
704
705```rust
706// BEFORE
707fn foo() {
708 if true {┃
709 println!("foo");
710 }
711}
712
713// AFTER
714fn foo() {
715 println!("foo");
716}
717```