Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/lib.rs')
| -rw-r--r-- | crates/hir/src/lib.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index a221c4d57e..2096c485e4 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -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 |