airmash_protocol/detail.rs
1macro_rules! impl_from_newtype_inner {
2 ($enum:tt, $type:tt) => {
3 impl From<$type> for $enum {
4 fn from(v: $type) -> Self {
5 $enum::$type(v)
6 }
7 }
8 };
9}
10
11macro_rules! impl_from_empty_inner {
12 ($enum:tt, $type:tt) => {
13 impl From<$type> for $enum {
14 fn from(_: $type) -> Self {
15 $enum::$type
16 }
17 }
18 };
19}