1#[macro_export] 2macro_rules! implement_from_for_wrapper { 3 ($self: ty, $type: ty, $variant: ident) => { 4 impl From<$type> for $self { 5 fn from(value: $type) -> Self { 6 Self::$variant(value) 7 } 8 } 9 }; 10}