mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +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
|
@ -74,7 +74,7 @@ fn variant_hints(
|
|||
},
|
||||
Some(InlayTooltip::String(match &d {
|
||||
Ok(_) => "enum variant discriminant".into(),
|
||||
Err(e) => format!("{e:?}").into(),
|
||||
Err(e) => format!("{e:?}"),
|
||||
})),
|
||||
None,
|
||||
);
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
//! ```
|
||||
use ide_db::{syntax_helpers::node_ext::walk_ty, FxHashMap};
|
||||
use itertools::Itertools;
|
||||
use syntax::SmolStr;
|
||||
use syntax::{
|
||||
ast::{self, AstNode, HasGenericParams, HasName},
|
||||
SyntaxToken,
|
||||
};
|
||||
use syntax::{format_smolstr, SmolStr};
|
||||
|
||||
use crate::{InlayHint, InlayHintPosition, InlayHintsConfig, InlayKind, LifetimeElisionHints};
|
||||
|
||||
|
@ -80,7 +80,7 @@ pub(super) fn hints(
|
|||
let mut gen_idx_name = {
|
||||
let mut gen = (0u8..).map(|idx| match idx {
|
||||
idx if idx < 10 => SmolStr::from_iter(['\'', (idx + 48) as char]),
|
||||
idx => format!("'{idx}").into(),
|
||||
idx => format_smolstr!("'{idx}"),
|
||||
});
|
||||
move || gen.next().unwrap_or_default()
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue