diff options
Diffstat (limited to 'docs/user')
-rw-r--r-- | docs/user/assists.md | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/user/assists.md b/docs/user/assists.md index 8e2e8cc94..182f07e98 100644 --- a/docs/user/assists.md +++ b/docs/user/assists.md | |||
@@ -245,3 +245,20 @@ fn main() { | |||
245 | (1 + 2) * 4; | 245 | (1 + 2) * 4; |
246 | } | 246 | } |
247 | ``` | 247 | ``` |
248 | |||
249 | ## `introduce_variable` | ||
250 | |||
251 | Extracts subexpression into a variable. | ||
252 | |||
253 | ```rust | ||
254 | // BEFORE | ||
255 | fn main() { | ||
256 | <|>(1 + 2)<|> * 4; | ||
257 | } | ||
258 | |||
259 | // AFTER | ||
260 | fn main() { | ||
261 | let var_name = (1 + 2); | ||
262 | var_name * 4; | ||
263 | } | ||
264 | ``` | ||