diff options
author | Aleksey Kladov <[email protected]> | 2018-08-28 12:06:30 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-28 12:06:30 +0100 |
commit | 7e74af32268f9b0783ca94107b0b10d52e4ebe5e (patch) | |
tree | 179d818c695a27ceee3f8193e219234854190f9a /crates/libeditor/src/code_actions.rs | |
parent | 363f466627db373fab23d1df94b7382223b8675a (diff) |
Avoid materializing strings
Diffstat (limited to 'crates/libeditor/src/code_actions.rs')
-rw-r--r-- | crates/libeditor/src/code_actions.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/libeditor/src/code_actions.rs b/crates/libeditor/src/code_actions.rs index e6ba83d2e..cd5146d87 100644 --- a/crates/libeditor/src/code_actions.rs +++ b/crates/libeditor/src/code_actions.rs | |||
@@ -29,8 +29,8 @@ pub fn flip_comma<'a>(file: &'a File, offset: TextUnit) -> Option<impl FnOnce() | |||
29 | let right = non_trivia_sibling(comma, Direction::Forward)?; | 29 | let right = non_trivia_sibling(comma, Direction::Forward)?; |
30 | Some(move || { | 30 | Some(move || { |
31 | let mut edit = EditBuilder::new(); | 31 | let mut edit = EditBuilder::new(); |
32 | edit.replace(left.range(), right.text()); | 32 | edit.replace(left.range(), right.text().to_string()); |
33 | edit.replace(right.range(), left.text()); | 33 | edit.replace(right.range(), left.text().to_string()); |
34 | ActionResult { | 34 | ActionResult { |
35 | edit: edit.finish(), | 35 | edit: edit.finish(), |
36 | cursor_position: None, | 36 | cursor_position: None, |