aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/diagnostics/fixes/replace_with_find_map.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide/src/diagnostics/fixes/replace_with_find_map.rs')
-rw-r--r--crates/ide/src/diagnostics/fixes/replace_with_find_map.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ide/src/diagnostics/fixes/replace_with_find_map.rs b/crates/ide/src/diagnostics/fixes/replace_with_find_map.rs
index b0ef7b44a..444bf563b 100644
--- a/crates/ide/src/diagnostics/fixes/replace_with_find_map.rs
+++ b/crates/ide/src/diagnostics/fixes/replace_with_find_map.rs
@@ -7,14 +7,14 @@ use syntax::{
7}; 7};
8use text_edit::TextEdit; 8use text_edit::TextEdit;
9 9
10use crate::diagnostics::{fix, DiagnosticWithFix}; 10use crate::diagnostics::{fix, DiagnosticWithFixes};
11 11
12impl DiagnosticWithFix for ReplaceFilterMapNextWithFindMap { 12impl DiagnosticWithFixes for ReplaceFilterMapNextWithFindMap {
13 fn fix( 13 fn fixes(
14 &self, 14 &self,
15 sema: &Semantics<RootDatabase>, 15 sema: &Semantics<RootDatabase>,
16 _resolve: &AssistResolveStrategy, 16 _resolve: &AssistResolveStrategy,
17 ) -> Option<Assist> { 17 ) -> Option<Vec<Assist>> {
18 let root = sema.db.parse_or_expand(self.file)?; 18 let root = sema.db.parse_or_expand(self.file)?;
19 let next_expr = self.next_expr.to_node(&root); 19 let next_expr = self.next_expr.to_node(&root);
20 let next_call = ast::MethodCallExpr::cast(next_expr.syntax().clone())?; 20 let next_call = ast::MethodCallExpr::cast(next_expr.syntax().clone())?;
@@ -32,12 +32,12 @@ impl DiagnosticWithFix for ReplaceFilterMapNextWithFindMap {
32 32
33 let source_change = SourceChange::from_text_edit(self.file.original_file(sema.db), edit); 33 let source_change = SourceChange::from_text_edit(self.file.original_file(sema.db), edit);
34 34
35 Some(fix( 35 Some(vec![fix(
36 "replace_with_find_map", 36 "replace_with_find_map",
37 "Replace filter_map(..).next() with find_map()", 37 "Replace filter_map(..).next() with find_map()",
38 source_change, 38 source_change,
39 trigger_range, 39 trigger_range,
40 )) 40 )])
41 } 41 }
42} 42}
43 43