use a more generic blanket impl
Rust/spacepackets/pipeline/head This commit looks good Details
Rust/spacepackets/pipeline/pr-main This commit looks good Details

This commit is contained in:
Robin Müller 2024-03-11 14:35:09 +01:00
parent 77862868d5
commit bd1927c5c2
Signed by: muellerr
GPG Key ID: A649FB78196E3849
1 changed files with 6 additions and 6 deletions

View File

@ -360,17 +360,17 @@ impl<TYPE: Debug + Copy + Clone + PartialEq + Eq + ToBeBytes + Into<u64>> EcssEn
{
}
impl<T: Copy + Into<u64>> From<T> for GenericEcssEnumWrapper<T> {
fn from(value: T) -> Self {
Self::new(value)
}
}
macro_rules! generic_ecss_enum_typedefs_and_from_impls {
($($ty:ty => $Enum:ident),*) => {
$(
pub type $Enum = GenericEcssEnumWrapper<$ty>;
impl From<$ty> for $Enum {
fn from(value: $ty) -> Self {
Self::new(value)
}
}
impl From<$Enum> for $ty {
fn from(value: $Enum) -> Self {
value.value_typed()