Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-db/src/source_change.rs')
| -rw-r--r-- | crates/ide-db/src/source_change.rs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/crates/ide-db/src/source_change.rs b/crates/ide-db/src/source_change.rs index b4d0b0dc9f..b1b58d6568 100644 --- a/crates/ide-db/src/source_change.rs +++ b/crates/ide-db/src/source_change.rs @@ -6,7 +6,7 @@ use std::{collections::hash_map::Entry, fmt, iter, mem}; use crate::text_edit::{TextEdit, TextEditBuilder}; -use crate::{assists::Command, syntax_helpers::tree_diff::diff, SnippetCap}; +use crate::{SnippetCap, assists::Command, syntax_helpers::tree_diff::diff}; use base_db::AnchoredPathBuf; use itertools::Itertools; use nohash_hasher::IntMap; @@ -14,8 +14,8 @@ use rustc_hash::FxHashMap; use span::FileId; use stdx::never; use syntax::{ - syntax_editor::{SyntaxAnnotation, SyntaxEditor}, AstNode, SyntaxElement, SyntaxNode, SyntaxNodePtr, SyntaxToken, TextRange, TextSize, + syntax_editor::{SyntaxAnnotation, SyntaxEditor}, }; /// An annotation ID associated with an indel, to describe changes. @@ -469,7 +469,7 @@ impl SourceChangeBuilder { } fn add_snippet_annotation(&mut self, kind: AnnotationSnippet) -> SyntaxAnnotation { - let annotation = SyntaxAnnotation::new(); + let annotation = SyntaxAnnotation::default(); self.snippet_annotations.push((kind, annotation)); self.source_change.is_snippet = true; annotation @@ -479,13 +479,14 @@ impl SourceChangeBuilder { self.commit(); // Only one file can have snippet edits - stdx::never!(self - .source_change - .source_file_edits - .iter() - .filter(|(_, (_, snippet_edit))| snippet_edit.is_some()) - .at_most_one() - .is_err()); + stdx::never!( + self.source_change + .source_file_edits + .iter() + .filter(|(_, (_, snippet_edit))| snippet_edit.is_some()) + .at_most_one() + .is_err() + ); mem::take(&mut self.source_change) } |