use a more generic blanket impl
All checks were successful
Rust/spacepackets/pipeline/head This commit looks good
Rust/spacepackets/pipeline/pr-main This commit looks good

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

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 { macro_rules! generic_ecss_enum_typedefs_and_from_impls {
($($ty:ty => $Enum:ident),*) => { ($($ty:ty => $Enum:ident),*) => {
$( $(
pub type $Enum = GenericEcssEnumWrapper<$ty>; pub type $Enum = GenericEcssEnumWrapper<$ty>;
impl From<$ty> for $Enum {
fn from(value: $ty) -> Self {
Self::new(value)
}
}
impl From<$Enum> for $ty { impl From<$Enum> for $ty {
fn from(value: $Enum) -> Self { fn from(value: $Enum) -> Self {
value.value_typed() value.value_typed()