@@ -23,7 +23,7 @@ use crate::{Assist, AssistCtx, AssistId};
23
23
// (1 + 2) * 4;
24
24
// }
25
25
// ```
26
- pub ( crate ) fn inline_local_varialbe ( ctx : AssistCtx < impl HirDatabase > ) -> Option < Assist > {
26
+ pub ( crate ) fn inline_local_variable ( ctx : AssistCtx < impl HirDatabase > ) -> Option < Assist > {
27
27
let let_stmt = ctx. find_node_at_offset :: < ast:: LetStmt > ( ) ?;
28
28
let bind_pat = match let_stmt. pat ( ) ? {
29
29
ast:: Pat :: BindPat ( pat) => pat,
@@ -117,7 +117,7 @@ mod tests {
117
117
#[ test]
118
118
fn test_inline_let_bind_literal_expr ( ) {
119
119
check_assist (
120
- inline_local_varialbe ,
120
+ inline_local_variable ,
121
121
"
122
122
fn bar(a: usize) {}
123
123
fn foo() {
@@ -151,7 +151,7 @@ fn foo() {
151
151
#[ test]
152
152
fn test_inline_let_bind_bin_expr ( ) {
153
153
check_assist (
154
- inline_local_varialbe ,
154
+ inline_local_variable ,
155
155
"
156
156
fn bar(a: usize) {}
157
157
fn foo() {
@@ -185,7 +185,7 @@ fn foo() {
185
185
#[ test]
186
186
fn test_inline_let_bind_function_call_expr ( ) {
187
187
check_assist (
188
- inline_local_varialbe ,
188
+ inline_local_variable ,
189
189
"
190
190
fn bar(a: usize) {}
191
191
fn foo() {
@@ -219,7 +219,7 @@ fn foo() {
219
219
#[ test]
220
220
fn test_inline_let_bind_cast_expr ( ) {
221
221
check_assist (
222
- inline_local_varialbe ,
222
+ inline_local_variable ,
223
223
"
224
224
fn bar(a: usize): usize { a }
225
225
fn foo() {
@@ -253,7 +253,7 @@ fn foo() {
253
253
#[ test]
254
254
fn test_inline_let_bind_block_expr ( ) {
255
255
check_assist (
256
- inline_local_varialbe ,
256
+ inline_local_variable ,
257
257
"
258
258
fn foo() {
259
259
let a<|> = { 10 + 1 };
@@ -285,7 +285,7 @@ fn foo() {
285
285
#[ test]
286
286
fn test_inline_let_bind_paren_expr ( ) {
287
287
check_assist (
288
- inline_local_varialbe ,
288
+ inline_local_variable ,
289
289
"
290
290
fn foo() {
291
291
let a<|> = ( 10 + 1 );
@@ -317,7 +317,7 @@ fn foo() {
317
317
#[ test]
318
318
fn test_not_inline_mut_variable ( ) {
319
319
check_assist_not_applicable (
320
- inline_local_varialbe ,
320
+ inline_local_variable ,
321
321
"
322
322
fn foo() {
323
323
let mut a<|> = 1 + 1;
@@ -329,7 +329,7 @@ fn foo() {
329
329
#[ test]
330
330
fn test_call_expr ( ) {
331
331
check_assist (
332
- inline_local_varialbe ,
332
+ inline_local_variable ,
333
333
"
334
334
fn foo() {
335
335
let a<|> = bar(10 + 1);
@@ -347,7 +347,7 @@ fn foo() {
347
347
#[ test]
348
348
fn test_index_expr ( ) {
349
349
check_assist (
350
- inline_local_varialbe ,
350
+ inline_local_variable ,
351
351
"
352
352
fn foo() {
353
353
let x = vec![1, 2, 3];
@@ -367,7 +367,7 @@ fn foo() {
367
367
#[ test]
368
368
fn test_method_call_expr ( ) {
369
369
check_assist (
370
- inline_local_varialbe ,
370
+ inline_local_variable ,
371
371
"
372
372
fn foo() {
373
373
let bar = vec![1];
@@ -387,7 +387,7 @@ fn foo() {
387
387
#[ test]
388
388
fn test_field_expr ( ) {
389
389
check_assist (
390
- inline_local_varialbe ,
390
+ inline_local_variable ,
391
391
"
392
392
struct Bar {
393
393
foo: usize
@@ -415,7 +415,7 @@ fn foo() {
415
415
#[ test]
416
416
fn test_try_expr ( ) {
417
417
check_assist (
418
- inline_local_varialbe ,
418
+ inline_local_variable ,
419
419
"
420
420
fn foo() -> Option<usize> {
421
421
let bar = Some(1);
@@ -437,7 +437,7 @@ fn foo() -> Option<usize> {
437
437
#[ test]
438
438
fn test_ref_expr ( ) {
439
439
check_assist (
440
- inline_local_varialbe ,
440
+ inline_local_variable ,
441
441
"
442
442
fn foo() {
443
443
let bar = 10;
@@ -455,7 +455,7 @@ fn foo() {
455
455
#[ test]
456
456
fn test_tuple_expr ( ) {
457
457
check_assist (
458
- inline_local_varialbe ,
458
+ inline_local_variable ,
459
459
"
460
460
fn foo() {
461
461
let a<|> = (10, 20);
@@ -471,7 +471,7 @@ fn foo() {
471
471
#[ test]
472
472
fn test_array_expr ( ) {
473
473
check_assist (
474
- inline_local_varialbe ,
474
+ inline_local_variable ,
475
475
"
476
476
fn foo() {
477
477
let a<|> = [1, 2, 3];
@@ -487,7 +487,7 @@ fn foo() {
487
487
#[ test]
488
488
fn test_paren ( ) {
489
489
check_assist (
490
- inline_local_varialbe ,
490
+ inline_local_variable ,
491
491
"
492
492
fn foo() {
493
493
let a<|> = (10 + 20);
@@ -505,7 +505,7 @@ fn foo() {
505
505
#[ test]
506
506
fn test_path_expr ( ) {
507
507
check_assist (
508
- inline_local_varialbe ,
508
+ inline_local_variable ,
509
509
"
510
510
fn foo() {
511
511
let d = 10;
@@ -525,7 +525,7 @@ fn foo() {
525
525
#[ test]
526
526
fn test_block_expr ( ) {
527
527
check_assist (
528
- inline_local_varialbe ,
528
+ inline_local_variable ,
529
529
"
530
530
fn foo() {
531
531
let a<|> = { 10 };
@@ -543,7 +543,7 @@ fn foo() {
543
543
#[ test]
544
544
fn test_used_in_different_expr1 ( ) {
545
545
check_assist (
546
- inline_local_varialbe ,
546
+ inline_local_variable ,
547
547
"
548
548
fn foo() {
549
549
let a<|> = 10 + 20;
@@ -565,7 +565,7 @@ fn foo() {
565
565
#[ test]
566
566
fn test_used_in_for_expr ( ) {
567
567
check_assist (
568
- inline_local_varialbe ,
568
+ inline_local_variable ,
569
569
"
570
570
fn foo() {
571
571
let a<|> = vec![10, 20];
@@ -581,7 +581,7 @@ fn foo() {
581
581
#[ test]
582
582
fn test_used_in_while_expr ( ) {
583
583
check_assist (
584
- inline_local_varialbe ,
584
+ inline_local_variable ,
585
585
"
586
586
fn foo() {
587
587
let a<|> = 1 > 0;
@@ -597,7 +597,7 @@ fn foo() {
597
597
#[ test]
598
598
fn test_used_in_break_expr ( ) {
599
599
check_assist (
600
- inline_local_varialbe ,
600
+ inline_local_variable ,
601
601
"
602
602
fn foo() {
603
603
let a<|> = 1 + 1;
@@ -617,7 +617,7 @@ fn foo() {
617
617
#[ test]
618
618
fn test_used_in_return_expr ( ) {
619
619
check_assist (
620
- inline_local_varialbe ,
620
+ inline_local_variable ,
621
621
"
622
622
fn foo() {
623
623
let a<|> = 1 > 0;
@@ -633,7 +633,7 @@ fn foo() {
633
633
#[ test]
634
634
fn test_used_in_match_expr ( ) {
635
635
check_assist (
636
- inline_local_varialbe ,
636
+ inline_local_variable ,
637
637
"
638
638
fn foo() {
639
639
let a<|> = 1 > 0;
0 commit comments