From 52754f617c21de1b1c4b5d2ac292da0889852ccd Mon Sep 17 00:00:00 2001 From: Jimmy Cuadra Date: Wed, 19 Jun 2019 23:36:16 -0700 Subject: [PATCH] Import Event trait in Serialize impl so event_type can be called. --- src/gen.rs | 2 ++ tests/ruma_events_macros.rs | 6 ------ 2 files changed, 2 insertions(+), 6 deletions(-) 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! {