1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
use syn::{Attribute, DeriveInput, Field}; pub(crate) trait WithAttrs { fn attrs(&self) -> &[Attribute]; } impl WithAttrs for DeriveInput { fn attrs(&self) -> &[Attribute] { &self.attrs } } impl WithAttrs for Field { fn attrs(&self) -> &[Attribute] { &self.attrs } }