mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Replace more Name::to_string usages with Name::to_smol_str
This commit is contained in:
parent
962be38004
commit
439a8194b0
24 changed files with 49 additions and 41 deletions
|
@ -580,7 +580,7 @@ impl Module {
|
|||
});
|
||||
for token in tokens {
|
||||
if token.kind() == SyntaxKind::IDENT
|
||||
&& token.text() == derive_name.as_str()
|
||||
&& token.text() == &**derive_name
|
||||
{
|
||||
precise_location = Some(token.text_range());
|
||||
break 'outer;
|
||||
|
@ -606,7 +606,12 @@ impl Module {
|
|||
}
|
||||
};
|
||||
acc.push(
|
||||
UnresolvedProcMacro { node, precise_location, macro_name: name }.into(),
|
||||
UnresolvedProcMacro {
|
||||
node,
|
||||
precise_location,
|
||||
macro_name: name.map(Into::into),
|
||||
}
|
||||
.into(),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -2219,7 +2224,7 @@ impl Impl {
|
|||
.attrs()
|
||||
.filter_map(|it| {
|
||||
let path = ModPath::from_src(db.upcast(), it.path()?, &hygenic)?;
|
||||
if path.as_ident()?.to_string() == "derive" {
|
||||
if path.as_ident()?.to_smol_str() == "derive" {
|
||||
Some(it)
|
||||
} else {
|
||||
None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue