Skip to content

Commit

Permalink
Corrected bad typing in Result::map_or_else doc
Browse files Browse the repository at this point in the history
The error value now includes the type of the success.
The success value now includes the type of the error.
  • Loading branch information
ivanbakel committed Aug 29, 2018
1 parent 5eb6791 commit 71b16d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libcore/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,10 +487,10 @@ impl<T, E> Result<T, E> {
/// ```
/// let k = 21;
///
/// let x = Ok("foo");
/// let x : Result<_, &str> = Ok("foo");
/// assert_eq!(x.map_or_else(|e| k * 2, |v| v.len()), 3);
///
/// let x = Err("bar");
/// let x : Result<&str, _> = Err("bar");
/// assert_eq!(x.map_or_else(|e| k * 2, |v| v.len()), 42);
/// ```
#[inline]
Expand Down

0 comments on commit 71b16d8

Please sign in to comment.