Closed
Description
The type signature of Result::map_or_else
:
pub fn map_or_else<U, D, F>(self, default: D, f: F) -> U where
F: FnOnce(T) -> U,
D: FnOnce(E) -> U,
Note how default
is the function that gets applied to the Err
variant. Then, the docstring (emphasis mine):
Maps a
Result<T, E>
toU
by applying a fallback function to a containedErr
value, or a default function to a containedOk
value.
I think this is a very unfortunate choice of words and should be changed.