From 7510048ec0a5d5e7136e3ea258954eb244d15baf Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 12 Aug 2020 16:58:56 +0200 Subject: Cleanup TextEdit API --- crates/ra_ide/src/diagnostics.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_ide/src/diagnostics.rs') diff --git a/crates/ra_ide/src/diagnostics.rs b/crates/ra_ide/src/diagnostics.rs index 07bf133bd..e006c7775 100644 --- a/crates/ra_ide/src/diagnostics.rs +++ b/crates/ra_ide/src/diagnostics.rs @@ -14,7 +14,7 @@ use ra_syntax::{ ast::{self, AstNode}, SyntaxNode, TextRange, T, }; -use ra_text_edit::{TextEdit, TextEditBuilder}; +use ra_text_edit::TextEdit; use crate::{Diagnostic, FileId, Fix, SourceFileEdit}; @@ -103,7 +103,7 @@ fn check_unnecessary_braces_in_use_statement( text_edit_for_remove_unnecessary_braces_with_self_in_use_statement(&single_use_tree) .unwrap_or_else(|| { let to_replace = single_use_tree.syntax().text().to_string(); - let mut edit_builder = TextEditBuilder::default(); + let mut edit_builder = TextEdit::builder(); edit_builder.delete(use_range); edit_builder.insert(use_range.start(), to_replace); edit_builder.finish() @@ -149,7 +149,7 @@ fn check_struct_shorthand_initialization( let field_expr = expr.syntax().text().to_string(); let field_name_is_tup_index = name_ref.as_tuple_field().is_some(); if field_name == field_expr && !field_name_is_tup_index { - let mut edit_builder = TextEditBuilder::default(); + let mut edit_builder = TextEdit::builder(); edit_builder.delete(record_field.syntax().text_range()); edit_builder.insert(record_field.syntax().text_range().start(), field_name); let edit = edit_builder.finish(); -- cgit v1.2.3