diff options
Diffstat (limited to 'crates/ide/src/diagnostics/fixes/wrap_tail_expr.rs')
-rw-r--r-- | crates/ide/src/diagnostics/fixes/wrap_tail_expr.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ide/src/diagnostics/fixes/wrap_tail_expr.rs b/crates/ide/src/diagnostics/fixes/wrap_tail_expr.rs index 66676064a..715a403b9 100644 --- a/crates/ide/src/diagnostics/fixes/wrap_tail_expr.rs +++ b/crates/ide/src/diagnostics/fixes/wrap_tail_expr.rs | |||
@@ -4,14 +4,14 @@ use ide_db::{source_change::SourceChange, RootDatabase}; | |||
4 | use syntax::AstNode; | 4 | use syntax::AstNode; |
5 | use text_edit::TextEdit; | 5 | use text_edit::TextEdit; |
6 | 6 | ||
7 | use crate::diagnostics::{fix, DiagnosticWithFix}; | 7 | use crate::diagnostics::{fix, DiagnosticWithFixes}; |
8 | 8 | ||
9 | impl DiagnosticWithFix for MissingOkOrSomeInTailExpr { | 9 | impl DiagnosticWithFixes for MissingOkOrSomeInTailExpr { |
10 | fn fix( | 10 | fn fixes( |
11 | &self, | 11 | &self, |
12 | sema: &Semantics<RootDatabase>, | 12 | sema: &Semantics<RootDatabase>, |
13 | _resolve: &AssistResolveStrategy, | 13 | _resolve: &AssistResolveStrategy, |
14 | ) -> Option<Assist> { | 14 | ) -> Option<Vec<Assist>> { |
15 | let root = sema.db.parse_or_expand(self.file)?; | 15 | let root = sema.db.parse_or_expand(self.file)?; |
16 | let tail_expr = self.expr.to_node(&root); | 16 | let tail_expr = self.expr.to_node(&root); |
17 | let tail_expr_range = tail_expr.syntax().text_range(); | 17 | let tail_expr_range = tail_expr.syntax().text_range(); |
@@ -19,7 +19,7 @@ impl DiagnosticWithFix for MissingOkOrSomeInTailExpr { | |||
19 | let edit = TextEdit::replace(tail_expr_range, replacement); | 19 | let edit = TextEdit::replace(tail_expr_range, replacement); |
20 | let source_change = SourceChange::from_text_edit(self.file.original_file(sema.db), edit); | 20 | let source_change = SourceChange::from_text_edit(self.file.original_file(sema.db), edit); |
21 | let name = if self.required == "Ok" { "Wrap with Ok" } else { "Wrap with Some" }; | 21 | let name = if self.required == "Ok" { "Wrap with Ok" } else { "Wrap with Some" }; |
22 | Some(fix("wrap_tail_expr", name, source_change, tail_expr_range)) | 22 | Some(vec![fix("wrap_tail_expr", name, source_change, tail_expr_range)]) |
23 | } | 23 | } |
24 | } | 24 | } |
25 | 25 | ||