diff options
Diffstat (limited to 'crates/assists/src/handlers/early_return.rs')
-rw-r--r-- | crates/assists/src/handlers/early_return.rs | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/crates/assists/src/handlers/early_return.rs b/crates/assists/src/handlers/early_return.rs index 2c48f32bf..8bbbb7ed5 100644 --- a/crates/assists/src/handlers/early_return.rs +++ b/crates/assists/src/handlers/early_return.rs | |||
@@ -24,7 +24,7 @@ use crate::{ | |||
24 | // | 24 | // |
25 | // ``` | 25 | // ``` |
26 | // fn main() { | 26 | // fn main() { |
27 | // <|>if cond { | 27 | // $0if cond { |
28 | // foo(); | 28 | // foo(); |
29 | // bar(); | 29 | // bar(); |
30 | // } | 30 | // } |
@@ -200,7 +200,7 @@ mod tests { | |||
200 | r#" | 200 | r#" |
201 | fn main() { | 201 | fn main() { |
202 | bar(); | 202 | bar(); |
203 | if<|> true { | 203 | if$0 true { |
204 | foo(); | 204 | foo(); |
205 | 205 | ||
206 | //comment | 206 | //comment |
@@ -230,7 +230,7 @@ mod tests { | |||
230 | r#" | 230 | r#" |
231 | fn main(n: Option<String>) { | 231 | fn main(n: Option<String>) { |
232 | bar(); | 232 | bar(); |
233 | if<|> let Some(n) = n { | 233 | if$0 let Some(n) = n { |
234 | foo(n); | 234 | foo(n); |
235 | 235 | ||
236 | //comment | 236 | //comment |
@@ -260,7 +260,7 @@ mod tests { | |||
260 | convert_to_guarded_return, | 260 | convert_to_guarded_return, |
261 | r#" | 261 | r#" |
262 | fn main() { | 262 | fn main() { |
263 | if<|> let Ok(x) = Err(92) { | 263 | if$0 let Ok(x) = Err(92) { |
264 | foo(x); | 264 | foo(x); |
265 | } | 265 | } |
266 | } | 266 | } |
@@ -284,7 +284,7 @@ mod tests { | |||
284 | r#" | 284 | r#" |
285 | fn main(n: Option<String>) { | 285 | fn main(n: Option<String>) { |
286 | bar(); | 286 | bar(); |
287 | if<|> let Ok(n) = n { | 287 | if$0 let Ok(n) = n { |
288 | foo(n); | 288 | foo(n); |
289 | 289 | ||
290 | //comment | 290 | //comment |
@@ -315,7 +315,7 @@ mod tests { | |||
315 | r#" | 315 | r#" |
316 | fn main() { | 316 | fn main() { |
317 | while true { | 317 | while true { |
318 | if<|> true { | 318 | if$0 true { |
319 | foo(); | 319 | foo(); |
320 | bar(); | 320 | bar(); |
321 | } | 321 | } |
@@ -343,7 +343,7 @@ mod tests { | |||
343 | r#" | 343 | r#" |
344 | fn main() { | 344 | fn main() { |
345 | while true { | 345 | while true { |
346 | if<|> let Some(n) = n { | 346 | if$0 let Some(n) = n { |
347 | foo(n); | 347 | foo(n); |
348 | bar(); | 348 | bar(); |
349 | } | 349 | } |
@@ -372,7 +372,7 @@ mod tests { | |||
372 | r#" | 372 | r#" |
373 | fn main() { | 373 | fn main() { |
374 | loop { | 374 | loop { |
375 | if<|> true { | 375 | if$0 true { |
376 | foo(); | 376 | foo(); |
377 | bar(); | 377 | bar(); |
378 | } | 378 | } |
@@ -400,7 +400,7 @@ mod tests { | |||
400 | r#" | 400 | r#" |
401 | fn main() { | 401 | fn main() { |
402 | loop { | 402 | loop { |
403 | if<|> let Some(n) = n { | 403 | if$0 let Some(n) = n { |
404 | foo(n); | 404 | foo(n); |
405 | bar(); | 405 | bar(); |
406 | } | 406 | } |
@@ -428,7 +428,7 @@ mod tests { | |||
428 | convert_to_guarded_return, | 428 | convert_to_guarded_return, |
429 | r#" | 429 | r#" |
430 | fn main() { | 430 | fn main() { |
431 | if<|> true { | 431 | if$0 true { |
432 | return; | 432 | return; |
433 | } | 433 | } |
434 | } | 434 | } |
@@ -443,7 +443,7 @@ mod tests { | |||
443 | r#" | 443 | r#" |
444 | fn main() { | 444 | fn main() { |
445 | loop { | 445 | loop { |
446 | if<|> true { | 446 | if$0 true { |
447 | continue; | 447 | continue; |
448 | } | 448 | } |
449 | } | 449 | } |
@@ -458,7 +458,7 @@ mod tests { | |||
458 | convert_to_guarded_return, | 458 | convert_to_guarded_return, |
459 | r#" | 459 | r#" |
460 | fn main() { | 460 | fn main() { |
461 | if<|> true { | 461 | if$0 true { |
462 | return | 462 | return |
463 | } | 463 | } |
464 | } | 464 | } |
@@ -472,7 +472,7 @@ mod tests { | |||
472 | convert_to_guarded_return, | 472 | convert_to_guarded_return, |
473 | r#" | 473 | r#" |
474 | fn main() { | 474 | fn main() { |
475 | if<|> true { | 475 | if$0 true { |
476 | foo(); | 476 | foo(); |
477 | } else { | 477 | } else { |
478 | bar() | 478 | bar() |
@@ -488,7 +488,7 @@ mod tests { | |||
488 | convert_to_guarded_return, | 488 | convert_to_guarded_return, |
489 | r#" | 489 | r#" |
490 | fn main() { | 490 | fn main() { |
491 | if<|> true { | 491 | if$0 true { |
492 | foo(); | 492 | foo(); |
493 | } | 493 | } |
494 | bar(); | 494 | bar(); |
@@ -504,7 +504,7 @@ mod tests { | |||
504 | r#" | 504 | r#" |
505 | fn main() { | 505 | fn main() { |
506 | if false { | 506 | if false { |
507 | if<|> true { | 507 | if$0 true { |
508 | foo(); | 508 | foo(); |
509 | } | 509 | } |
510 | } | 510 | } |