events-macros: Get rid of duplicate helper functions

This commit is contained in:
Jonas Platte 2021-10-01 20:16:23 +02:00
parent d77f58dc46
commit 2536fdbe54
No known key found for this signature in database
GPG Key ID: 7D261D771D915378
2 changed files with 1 additions and 13 deletions

View File

@ -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>

View File

@ -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.