syn icon indicating copy to clipboard operation
syn copied to clipboard

Add `Item::attrs` to get the attributes of an item if available

Open kraktus opened this issue 2 years ago • 1 comments

Hello, thanks for the crate!

When looking at Item I was surprised not to find APIs that ease its use, without having to pattern-match every time, like for rustc_hir::ItemKind. This PR add a convenience method to have an easy access to the attributes of an item.

I don't know the policy about new APIs, so feel free to close if deemed out-of-scope. About the feature-flag to use and the documentation I can fix what's needed, when for parsing as a first guess.

As a side note test_expr_size and test_type_size fail on arm64 (M1).

kraktus avatar Dec 22 '22 18:12 kraktus