aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/diagnostics
diff options
context:
space:
mode:
authorPhil Ellison <[email protected]>2020-12-30 15:52:36 +0000
committerPhil Ellison <[email protected]>2021-01-23 07:40:25 +0000
commit449ced4d218f413e152785fb81d161a6389974f7 (patch)
tree43ef0fd77b74bbc8d5ae78408f6d33d08c139fa7 /crates/ide/src/diagnostics
parent1ff860b93c972e0f8d3a8ee582c255fa59e9b284 (diff)
cargo fmt
Diffstat (limited to 'crates/ide/src/diagnostics')
-rw-r--r--crates/ide/src/diagnostics/fixes.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/crates/ide/src/diagnostics/fixes.rs b/crates/ide/src/diagnostics/fixes.rs
index 7bbf1d8c7..a73c0778b 100644
--- a/crates/ide/src/diagnostics/fixes.rs
+++ b/crates/ide/src/diagnostics/fixes.rs
@@ -14,7 +14,11 @@ use ide_db::{
14 source_change::{FileSystemEdit, SourceChange}, 14 source_change::{FileSystemEdit, SourceChange},
15 RootDatabase, 15 RootDatabase,
16}; 16};
17use syntax::{AstNode, TextRange, algo, ast::{self, ArgList, edit::IndentLevel, make}}; 17use syntax::{
18 algo,
19 ast::{self, edit::IndentLevel, make, ArgList},
20 AstNode, TextRange,
21};
18use text_edit::TextEdit; 22use text_edit::TextEdit;
19 23
20use crate::{diagnostics::Fix, references::rename::rename_with_semantics, FilePosition}; 24use crate::{diagnostics::Fix, references::rename::rename_with_semantics, FilePosition};
@@ -151,7 +155,8 @@ impl DiagnosticWithFix for ReplaceFilterMapNextWithFindMap {
151 let filter_map_name_range = filter_map_call.name_ref()?.ident_token()?.text_range(); 155 let filter_map_name_range = filter_map_call.name_ref()?.ident_token()?.text_range();
152 let filter_map_args = filter_map_call.syntax().children().find_map(ArgList::cast)?; 156 let filter_map_args = filter_map_call.syntax().children().find_map(ArgList::cast)?;
153 157
154 let range_to_replace = TextRange::new(filter_map_name_range.start(), next_expr.syntax().text_range().end()); 158 let range_to_replace =
159 TextRange::new(filter_map_name_range.start(), next_expr.syntax().text_range().end());
155 let replacement = format!("find_map{}", filter_map_args.syntax().text()); 160 let replacement = format!("find_map{}", filter_map_args.syntax().text());
156 let trigger_range = next_expr.syntax().text_range(); 161 let trigger_range = next_expr.syntax().text_range();
157 162