macro_rules! impl_from { ($a:ident<$c:lifetime>, $b:ident::$enum_type:ident) => { ... }; ($a:ident, $b:ident::$enum_type:ident) => { ... }; }
Expand description
Implement the From
trait for any type.
Example usage:
enum MyError<'a> {
Bar(BarError<'a>)
Foo(FooError<'a>)
}
impl_from!(BarError<'a>, Error::Bar);
impl_from!(BarError<'a>, Error::Bar);