From d6187de4cd34a1288c7820c5477b81b1e9b692a9 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Fri, 9 Apr 2021 14:50:42 +0200 Subject: Use `name![derive]` --- crates/hir_expand/src/input.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'crates/hir_expand/src') diff --git a/crates/hir_expand/src/input.rs b/crates/hir_expand/src/input.rs index 40f8da696..d1f22aba4 100644 --- a/crates/hir_expand/src/input.rs +++ b/crates/hir_expand/src/input.rs @@ -5,7 +5,11 @@ use syntax::{ AstNode, SyntaxNode, }; -use crate::{db::AstDatabase, name::AsName, AttrId, LazyMacroId, MacroCallKind, MacroCallLoc}; +use crate::{ + db::AstDatabase, + name::{name, AsName}, + AttrId, LazyMacroId, MacroCallKind, MacroCallLoc, +}; pub(crate) fn process_macro_input( db: &dyn AstDatabase, @@ -35,7 +39,7 @@ fn remove_derives_up_to(item: ast::Item, attr: AttrId) -> ast::Item { if let Some(name) = attr.path().and_then(|path| path.as_single_segment()).and_then(|seg| seg.name_ref()) { - if name.as_name().to_string() == "derive" { + if name.as_name() == name![derive] { attr.syntax().detach(); } } -- cgit v1.2.3