diff options
author | Jonas Schievink <[email protected]> | 2021-04-09 13:50:42 +0100 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-04-09 13:50:42 +0100 |
commit | d6187de4cd34a1288c7820c5477b81b1e9b692a9 (patch) | |
tree | 77b5d618616d218f4965fd96fa08a0831c13bc39 /crates/hir_expand/src | |
parent | c51213c2e7de21b7e68e6773ca3be0cdfc7c18af (diff) |
Use `name![derive]`
Diffstat (limited to 'crates/hir_expand/src')
-rw-r--r-- | crates/hir_expand/src/input.rs | 8 |
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 | ||
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 | }; | ||
9 | 13 | ||
10 | pub(crate) fn process_macro_input( | 14 | pub(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 | } |