aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoradamrk <[email protected]>2020-02-20 09:34:22 +0000
committeradamrk <[email protected]>2020-02-21 22:51:30 +0000
commitfe8ce4c41d5f82ab164e76aef6c504c99fdff410 (patch)
tree72909c3e5d3051357c0bc0f6e121f65eec4ba0f1
parent7be104410468a1fdcb01e5b98bedb7438b2c99f0 (diff)
remove unneeded `collect`
-rw-r--r--crates/ra_ide/src/references/rename.rs18
1 files changed, 7 insertions, 11 deletions
diff --git a/crates/ra_ide/src/references/rename.rs b/crates/ra_ide/src/references/rename.rs
index bcb62b33d..bdb90020b 100644
--- a/crates/ra_ide/src/references/rename.rs
+++ b/crates/ra_ide/src/references/rename.rs
@@ -99,17 +99,13 @@ fn rename_mod(
99 source_file_edits.push(edit); 99 source_file_edits.push(edit);
100 100
101 if let Some(RangeInfo { range: _, info: refs }) = find_all_refs(db, position, None) { 101 if let Some(RangeInfo { range: _, info: refs }) = find_all_refs(db, position, None) {
102 let ref_edits = refs 102 let ref_edits = refs.references.into_iter().map(|reference| {
103 .references 103 source_edit_from_file_id_range(
104 .into_iter() 104 reference.file_range.file_id,
105 .map(|reference| { 105 reference.file_range.range,
106 source_edit_from_file_id_range( 106 new_name,
107 reference.file_range.file_id, 107 )
108 reference.file_range.range, 108 });
109 new_name,
110 )
111 })
112 .collect::<Vec<_>>();
113 source_file_edits.extend(ref_edits); 109 source_file_edits.extend(ref_edits);
114 } 110 }
115 111