diff options
Diffstat (limited to 'crates/ra_editor/src/diagnostics.rs')
-rw-r--r-- | crates/ra_editor/src/diagnostics.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_editor/src/diagnostics.rs b/crates/ra_editor/src/diagnostics.rs index 1b336cfe2..199b0e502 100644 --- a/crates/ra_editor/src/diagnostics.rs +++ b/crates/ra_editor/src/diagnostics.rs | |||
@@ -57,7 +57,7 @@ fn check_unnecessary_braces_in_use_statement( | |||
57 | text_edit_for_remove_unnecessary_braces_with_self_in_use_statement(single_use_tree) | 57 | text_edit_for_remove_unnecessary_braces_with_self_in_use_statement(single_use_tree) |
58 | .unwrap_or_else(|| { | 58 | .unwrap_or_else(|| { |
59 | let to_replace = single_use_tree.syntax().text().to_string(); | 59 | let to_replace = single_use_tree.syntax().text().to_string(); |
60 | let mut edit_builder = TextEditBuilder::new(); | 60 | let mut edit_builder = TextEditBuilder::default(); |
61 | edit_builder.delete(range); | 61 | edit_builder.delete(range); |
62 | edit_builder.insert(range.start(), to_replace); | 62 | edit_builder.insert(range.start(), to_replace); |
63 | edit_builder.finish() | 63 | edit_builder.finish() |
@@ -93,7 +93,7 @@ fn text_edit_for_remove_unnecessary_braces_with_self_in_use_statement( | |||
93 | let start = use_tree_list_node.prev_sibling()?.range().start(); | 93 | let start = use_tree_list_node.prev_sibling()?.range().start(); |
94 | let end = use_tree_list_node.range().end(); | 94 | let end = use_tree_list_node.range().end(); |
95 | let range = TextRange::from_to(start, end); | 95 | let range = TextRange::from_to(start, end); |
96 | let mut edit_builder = TextEditBuilder::new(); | 96 | let mut edit_builder = TextEditBuilder::default(); |
97 | edit_builder.delete(range); | 97 | edit_builder.delete(range); |
98 | return Some(edit_builder.finish()); | 98 | return Some(edit_builder.finish()); |
99 | } | 99 | } |
@@ -111,7 +111,7 @@ fn check_struct_shorthand_initialization( | |||
111 | let field_name = name_ref.syntax().text().to_string(); | 111 | let field_name = name_ref.syntax().text().to_string(); |
112 | let field_expr = expr.syntax().text().to_string(); | 112 | let field_expr = expr.syntax().text().to_string(); |
113 | if field_name == field_expr { | 113 | if field_name == field_expr { |
114 | let mut edit_builder = TextEditBuilder::new(); | 114 | let mut edit_builder = TextEditBuilder::default(); |
115 | edit_builder.delete(named_field.syntax().range()); | 115 | edit_builder.delete(named_field.syntax().range()); |
116 | edit_builder.insert(named_field.syntax().range().start(), field_name); | 116 | edit_builder.insert(named_field.syntax().range().start(), field_name); |
117 | let edit = edit_builder.finish(); | 117 | let edit = edit_builder.finish(); |