minor: Make use of some new SmolStr improvements

This commit is contained in:
Lukas Wirth 2024-01-17 13:43:18 +01:00
parent 0bdbf497b6
commit 83591268ab
18 changed files with 80 additions and 61 deletions

View file

@ -17,7 +17,7 @@ use ide_db::{
imports::import_assets::LocatedImport,
RootDatabase, SnippetCap, SymbolKind,
};
use syntax::{AstNode, SmolStr, SyntaxKind, TextRange};
use syntax::{format_smolstr, AstNode, SmolStr, SyntaxKind, TextRange};
use text_edit::TextEdit;
use crate::{
@ -202,7 +202,7 @@ fn field_with_receiver(
) -> SmolStr {
receiver.map_or_else(
|| field_name.into(),
|receiver| format!("{}.{field_name}", receiver.display(db)).into(),
|receiver| format_smolstr!("{}.{field_name}", receiver.display(db)),
)
}