aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_expand/src
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2021-04-09 13:50:42 +0100
committerJonas Schievink <[email protected]>2021-04-09 13:50:42 +0100
commitd6187de4cd34a1288c7820c5477b81b1e9b692a9 (patch)
tree77b5d618616d218f4965fd96fa08a0831c13bc39 /crates/hir_expand/src
parentc51213c2e7de21b7e68e6773ca3be0cdfc7c18af (diff)
Use `name![derive]`
Diffstat (limited to 'crates/hir_expand/src')
-rw-r--r--crates/hir_expand/src/input.rs8
1 files changed, 6 insertions, 2 deletions
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::{
5 AstNode, SyntaxNode, 5 AstNode, SyntaxNode,
6}; 6};
7 7
8use crate::{db::AstDatabase, name::AsName, AttrId, LazyMacroId, MacroCallKind, MacroCallLoc}; 8use crate::{
9 db::AstDatabase,
10 name::{name, AsName},
11 AttrId, LazyMacroId, MacroCallKind, MacroCallLoc,
12};
9 13
10pub(crate) fn process_macro_input( 14pub(crate) fn process_macro_input(
11 db: &dyn AstDatabase, 15 db: &dyn AstDatabase,
@@ -35,7 +39,7 @@ fn remove_derives_up_to(item: ast::Item, attr: AttrId) -> ast::Item {
35 if let Some(name) = 39 if let Some(name) =
36 attr.path().and_then(|path| path.as_single_segment()).and_then(|seg| seg.name_ref()) 40 attr.path().and_then(|path| path.as_single_segment()).and_then(|seg| seg.name_ref())
37 { 41 {
38 if name.as_name().to_string() == "derive" { 42 if name.as_name() == name![derive] {
39 attr.syntax().detach(); 43 attr.syntax().detach();
40 } 44 }
41 } 45 }