Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-completion/src/item.rs')
| -rw-r--r-- | crates/ide-completion/src/item.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/ide-completion/src/item.rs b/crates/ide-completion/src/item.rs index affd9b7296..5935a6c563 100644 --- a/crates/ide-completion/src/item.rs +++ b/crates/ide-completion/src/item.rs @@ -10,7 +10,7 @@ use ide_db::{ use itertools::Itertools; use smallvec::SmallVec; use stdx::{impl_from, never}; -use syntax::{SmolStr, TextRange, TextSize}; +use syntax::{format_smolstr, SmolStr, TextRange, TextSize}; use text_edit::TextEdit; use crate::{ @@ -442,7 +442,7 @@ impl Builder { if !self.doc_aliases.is_empty() { let doc_aliases = self.doc_aliases.iter().join(", "); - label_detail.replace(SmolStr::from(format!(" (alias {doc_aliases})"))); + label_detail.replace(format_smolstr!(" (alias {doc_aliases})")); let lookup_doc_aliases = self .doc_aliases .iter() @@ -459,21 +459,21 @@ impl Builder { // after typing a comma or space. .join(""); if !lookup_doc_aliases.is_empty() { - lookup = SmolStr::from(format!("{lookup}{lookup_doc_aliases}")); + lookup = format_smolstr!("{lookup}{lookup_doc_aliases}"); } } if let [import_edit] = &*self.imports_to_add { // snippets can have multiple imports, but normal completions only have up to one - label_detail.replace(SmolStr::from(format!( + label_detail.replace(format_smolstr!( "{} (use {})", label_detail.as_deref().unwrap_or_default(), import_edit.import_path.display(db) - ))); + )); } else if let Some(trait_name) = self.trait_name { - label_detail.replace(SmolStr::from(format!( + label_detail.replace(format_smolstr!( "{} (as {trait_name})", label_detail.as_deref().unwrap_or_default(), - ))); + )); } let text_edit = match self.text_edit { |