mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
minor: Make use of some new SmolStr
improvements
This commit is contained in:
parent
0bdbf497b6
commit
83591268ab
18 changed files with 80 additions and 61 deletions
|
@ -4,7 +4,7 @@ use hir::{db::HirDatabase, AsAssocItem, HirDisplay};
|
|||
use ide_db::{SnippetCap, SymbolKind};
|
||||
use itertools::Itertools;
|
||||
use stdx::{format_to, to_lower_snake_case};
|
||||
use syntax::{AstNode, SmolStr};
|
||||
use syntax::{format_smolstr, AstNode, SmolStr};
|
||||
|
||||
use crate::{
|
||||
context::{CompletionContext, DotAccess, DotAccessKind, PathCompletionCtx, PathKind},
|
||||
|
@ -52,13 +52,12 @@ fn render(
|
|||
|
||||
let (call, escaped_call) = match &func_kind {
|
||||
FuncKind::Method(_, Some(receiver)) => (
|
||||
format!(
|
||||
format_smolstr!(
|
||||
"{}.{}",
|
||||
receiver.unescaped().display(ctx.db()),
|
||||
name.unescaped().display(ctx.db())
|
||||
)
|
||||
.into(),
|
||||
format!("{}.{}", receiver.display(ctx.db()), name.display(ctx.db())).into(),
|
||||
),
|
||||
format_smolstr!("{}.{}", receiver.display(ctx.db()), name.display(ctx.db())),
|
||||
),
|
||||
_ => (name.unescaped().to_smol_str(), name.to_smol_str()),
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue