diff --git a/src/either_or_both/mod.rs b/src/either_or_both/mod.rs index 1122f37..4c5e051 100644 --- a/src/either_or_both/mod.rs +++ b/src/either_or_both/mod.rs @@ -1841,7 +1841,10 @@ impl EitherOrBoth { /// assert_eq!(value.map_right(map_right), EitherOrBoth::Left(1)); /// ``` #[inline] - pub fn map_right(self, f: fn(R) -> T) -> EitherOrBoth { + pub fn map_right(self, f: F) -> EitherOrBoth + where + F: FnOnce(R) -> T, + { map_each!(self; l, r => l, f(r)) }