Macro map_both
#[macro_export]
macro_rules! map_both {
($value:expr, $pattern:pat => $result:expr) => { ... };
($name:ident => $result:expr) => { ... };
}
Evaluate the provided expression for both Either::Left and Either::Right,
returning an Either with the results.
This macro is useful in cases where both sides of Either can be interacted with
in the same way even though the don't share the same type.
Syntax: either::map_both!( expression , pattern => expression )
Unlike [for_both!], this macro returns an Either with the results of the expressions.
Example
use Either;
;
use Either;