1 | use proc_macro2::Span; |
---|---|
2 | use syn::Member; |
3 | |
4 | pub trait MemberSpan { |
5 | fn member_span(&self) -> Span; |
6 | } |
7 | |
8 | impl MemberSpan for Member { |
9 | fn member_span(&self) -> Span { |
10 | match self { |
11 | Member::Named(ident: &Ident) => ident.span(), |
12 | Member::Unnamed(index: &Index) => index.span, |
13 | } |
14 | } |
15 | } |
16 |