Don't copy-paste impl_froms into every crate

This commit is contained in:
Aleksey Kladov
2020-07-13 16:16:53 +02:00
parent 6b4cf5b7d8
commit 693ac892f2
12 changed files with 69 additions and 106 deletions

View File

@@ -6,25 +6,6 @@ macro_rules! eprintln {
($($tt:tt)*) => { stdx::eprintln!($($tt)*) };
}
macro_rules! impl_froms {
($e:ident: $($v:ident $(($($sv:ident),*))?),*) => {
$(
impl From<$v> for $e {
fn from(it: $v) -> $e {
$e::$v(it)
}
}
$($(
impl From<$sv> for $e {
fn from(it: $sv) -> $e {
$e::$v($v::$sv(it))
}
}
)*)?
)*
}
}
mod autoderef;
pub mod primitive;
pub mod traits;