Debian Codegraph @

debian/rust-vendor/rstest_macros/src/parse/macros.rs

raw
1 macro_rules! wrap_attributes {
2 ($ident:ident) => {
3 #[derive(Default, Debug, PartialEq, Clone)]
4 pub(crate) struct $ident {
5 inner: Attributes,
6 }
7
8 impl From<Attributes> for $ident {
9 fn from(inner: Attributes) -> Self {
10 $ident { inner }
11 }
12 }
13
14 impl $ident {
15 fn iter(&self) -> impl Iterator<Item = &Attribute> {
16 self.inner.attributes.iter()
17 }
18 }
19
20 impl $ident {
21 #[allow(dead_code)]
22 pub(crate) fn append(&mut self, attr: Attribute) {
23 self.inner.attributes.push(attr)
24 }
25 }
26 };
27 }