Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir_def/src/attr.rs')
| -rw-r--r-- | crates/hir_def/src/attr.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/hir_def/src/attr.rs b/crates/hir_def/src/attr.rs index b4ddfba0d0..98177f4301 100644 --- a/crates/hir_def/src/attr.rs +++ b/crates/hir_def/src/attr.rs @@ -72,6 +72,11 @@ impl ops::Deref for RawAttrs { } } } +impl Attrs { + pub fn get(&self, AttrId { ast_index, .. }: AttrId) -> Option<&Attr> { + (**self).get(ast_index as usize) + } +} impl ops::Deref for Attrs { type Target = [Attr]; |