add iter_mut method to events struct
This commit is contained in:
parent
b1d7f80dad
commit
d4aee284e5
|
@ -42,6 +42,16 @@ macro_rules! declare_events_struct {
|
||||||
)
|
)
|
||||||
)*
|
)*
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn iter_mut(&mut self) -> impl Iterator<Item = (&'static str, &mut T)> {
|
||||||
|
iter::empty()
|
||||||
|
$(
|
||||||
|
.chain(
|
||||||
|
self.$name.iter_mut()
|
||||||
|
.map(|value| (stringify!($name), value))
|
||||||
|
)
|
||||||
|
)*
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> Default for Events<T> {
|
impl<T> Default for Events<T> {
|
||||||
|
|
Loading…
Reference in New Issue