Skip to content

Commit d6187de

Browse files
Use name![derive]
1 parent c51213c commit d6187de

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

crates/hir_expand/src/input.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ use syntax::{
55
AstNode, SyntaxNode,
66
};
77

8-
use crate::{db::AstDatabase, name::AsName, AttrId, LazyMacroId, MacroCallKind, MacroCallLoc};
8+
use crate::{
9+
db::AstDatabase,
10+
name::{name, AsName},
11+
AttrId, LazyMacroId, MacroCallKind, MacroCallLoc,
12+
};
913

1014
pub(crate) fn process_macro_input(
1115
db: &dyn AstDatabase,
@@ -35,7 +39,7 @@ fn remove_derives_up_to(item: ast::Item, attr: AttrId) -> ast::Item {
3539
if let Some(name) =
3640
attr.path().and_then(|path| path.as_single_segment()).and_then(|seg| seg.name_ref())
3741
{
38-
if name.as_name().to_string() == "derive" {
42+
if name.as_name() == name![derive] {
3943
attr.syntax().detach();
4044
}
4145
}

0 commit comments

Comments
 (0)