diff options
Diffstat (limited to 'crates/ide/src/diagnostics/field_shorthand.rs')
-rw-r--r-- | crates/ide/src/diagnostics/field_shorthand.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/crates/ide/src/diagnostics/field_shorthand.rs b/crates/ide/src/diagnostics/field_shorthand.rs index 2b1787f9b..01bd2dba6 100644 --- a/crates/ide/src/diagnostics/field_shorthand.rs +++ b/crates/ide/src/diagnostics/field_shorthand.rs | |||
@@ -46,14 +46,13 @@ fn check_expr_field_shorthand( | |||
46 | 46 | ||
47 | let field_range = record_field.syntax().text_range(); | 47 | let field_range = record_field.syntax().text_range(); |
48 | acc.push( | 48 | acc.push( |
49 | Diagnostic::hint(field_range, "Shorthand struct initialization".to_string()).with_fix( | 49 | Diagnostic::hint(field_range, "Shorthand struct initialization".to_string()) |
50 | Some(fix( | 50 | .with_fixes(Some(vec![fix( |
51 | "use_expr_field_shorthand", | 51 | "use_expr_field_shorthand", |
52 | "Use struct shorthand initialization", | 52 | "Use struct shorthand initialization", |
53 | SourceChange::from_text_edit(file_id, edit), | 53 | SourceChange::from_text_edit(file_id, edit), |
54 | field_range, | 54 | field_range, |
55 | )), | 55 | )])), |
56 | ), | ||
57 | ); | 56 | ); |
58 | } | 57 | } |
59 | } | 58 | } |
@@ -86,13 +85,13 @@ fn check_pat_field_shorthand( | |||
86 | let edit = edit_builder.finish(); | 85 | let edit = edit_builder.finish(); |
87 | 86 | ||
88 | let field_range = record_pat_field.syntax().text_range(); | 87 | let field_range = record_pat_field.syntax().text_range(); |
89 | acc.push(Diagnostic::hint(field_range, "Shorthand struct pattern".to_string()).with_fix( | 88 | acc.push(Diagnostic::hint(field_range, "Shorthand struct pattern".to_string()).with_fixes( |
90 | Some(fix( | 89 | Some(vec![fix( |
91 | "use_pat_field_shorthand", | 90 | "use_pat_field_shorthand", |
92 | "Use struct field shorthand", | 91 | "Use struct field shorthand", |
93 | SourceChange::from_text_edit(file_id, edit), | 92 | SourceChange::from_text_edit(file_id, edit), |
94 | field_range, | 93 | field_range, |
95 | )), | 94 | )]), |
96 | )); | 95 | )); |
97 | } | 96 | } |
98 | } | 97 | } |