diff --git a/crates/ruma-events-macros/src/event.rs b/crates/ruma-events-macros/src/event.rs index aa920064..d9106561 100644 --- a/crates/ruma-events-macros/src/event.rs +++ b/crates/ruma-events-macros/src/event.rs @@ -407,7 +407,7 @@ fn expand_from_into( let fields: Vec<_> = fields.iter().flat_map(|f| &f.ident).collect(); if let EventKindVariation::Sync | EventKindVariation::RedactedSync = var { - let full_struct = kind.to_event_ident(&var.to_full_variation()); + let full_struct = kind.to_event_ident(&var.to_full().unwrap()); Some(quote! { #[automatically_derived] impl #impl_generics ::std::convert::From<#full_struct #ty_gen> diff --git a/crates/ruma-events-macros/src/event_parse.rs b/crates/ruma-events-macros/src/event_parse.rs index 6ce133d5..68880d5c 100644 --- a/crates/ruma-events-macros/src/event_parse.rs +++ b/crates/ruma-events-macros/src/event_parse.rs @@ -60,18 +60,6 @@ impl EventKindVariation { _ => None, } } - - pub fn to_full_variation(self) -> Self { - match self { - EventKindVariation::Redacted | EventKindVariation::RedactedSync => { - EventKindVariation::Redacted - } - EventKindVariation::Full - | EventKindVariation::Sync - | EventKindVariation::Stripped - | EventKindVariation::Initial => EventKindVariation::Full, - } - } } // If the variants of this enum change `to_event_path` needs to be updated as well.