diff --git a/src/gen.rs b/src/gen.rs index 204bda9e..8f93e4b6 100644 --- a/src/gen.rs +++ b/src/gen.rs @@ -281,6 +281,8 @@ impl ToTokens for RumaEvent { where S: serde::Serializer { + use crate::Event as _; + let mut state = serializer.serialize_struct(#name_str, #field_count)?; #(#serialize_field_calls)* diff --git a/tests/ruma_events_macros.rs b/tests/ruma_events_macros.rs index c3be78f7..14b74815 100644 --- a/tests/ruma_events_macros.rs +++ b/tests/ruma_events_macros.rs @@ -76,8 +76,6 @@ impl From for InvalidEvent { // See note about wrapping macro expansion in a module from `src/lib.rs` pub mod common_case { - use super::Event; - use ruma_events_macros::ruma_event; ruma_event! { @@ -94,8 +92,6 @@ pub mod common_case { } pub mod extra_fields { - use super::Event; - use ruma_events_macros::ruma_event; ruma_event! { @@ -116,8 +112,6 @@ pub mod extra_fields { } pub mod type_alias { - use super::Event; - use ruma_events_macros::ruma_event; ruma_event! {