diff options
author | Jonas Schievink <[email protected]> | 2021-03-19 18:56:13 +0000 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-03-19 18:56:13 +0000 |
commit | 93aeb16eb21709de38ba8484fa82ed4e05ae5665 (patch) | |
tree | 6f4808ef6a79fa816d6b03d18234f27a0ed59c42 /crates/hir_def/src | |
parent | 0392e63c95736e988bda0fc62261ef48e89b3a31 (diff) |
Return `Either` from `MacroDefId::ast_id`
Diffstat (limited to 'crates/hir_def/src')
-rw-r--r-- | crates/hir_def/src/attr.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/hir_def/src/attr.rs b/crates/hir_def/src/attr.rs index 0360fb627..beeaaf117 100644 --- a/crates/hir_def/src/attr.rs +++ b/crates/hir_def/src/attr.rs | |||
@@ -208,9 +208,10 @@ impl Attrs { | |||
208 | AdtId::UnionId(it) => attrs_from_item_tree(it.lookup(db).id, db), | 208 | AdtId::UnionId(it) => attrs_from_item_tree(it.lookup(db).id, db), |
209 | }, | 209 | }, |
210 | AttrDefId::TraitId(it) => attrs_from_item_tree(it.lookup(db).id, db), | 210 | AttrDefId::TraitId(it) => attrs_from_item_tree(it.lookup(db).id, db), |
211 | AttrDefId::MacroDefId(it) => { | 211 | AttrDefId::MacroDefId(it) => it |
212 | it.ast_id().map_or_else(Default::default, |ast_id| attrs_from_ast(ast_id, db)) | 212 | .ast_id() |
213 | } | 213 | .left() |
214 | .map_or_else(Default::default, |ast_id| attrs_from_ast(ast_id, db)), | ||
214 | AttrDefId::ImplId(it) => attrs_from_item_tree(it.lookup(db).id, db), | 215 | AttrDefId::ImplId(it) => attrs_from_item_tree(it.lookup(db).id, db), |
215 | AttrDefId::ConstId(it) => attrs_from_item_tree(it.lookup(db).id, db), | 216 | AttrDefId::ConstId(it) => attrs_from_item_tree(it.lookup(db).id, db), |
216 | AttrDefId::StaticId(it) => attrs_from_item_tree(it.lookup(db).id, db), | 217 | AttrDefId::StaticId(it) => attrs_from_item_tree(it.lookup(db).id, db), |