diff options
| author | Isaac van Bakel <ivb@vanbakel.io> | 2018-08-29 14:58:27 +0100 |
|---|---|---|
| committer | Isaac van Bakel <ivb@vanbakel.io> | 2018-08-29 22:15:17 +0100 |
| commit | 71b16d8350d6f3dcc9b1d624de9332d99ea3acd0 (patch) | |
| tree | 2686b152d4f88d0a327ab6380236179701dc1772 | |
| parent | 5eb679105fc4b6827ec64c7cfab12c652a01d6b0 (diff) | |
| download | rust-71b16d8350d6f3dcc9b1d624de9332d99ea3acd0.tar.gz rust-71b16d8350d6f3dcc9b1d624de9332d99ea3acd0.zip | |
Corrected bad typing in Result::map_or_else doc
The error value now includes the type of the success. The success value now includes the type of the error.
| -rw-r--r-- | src/libcore/result.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/result.rs b/src/libcore/result.rs index 2493c63ab86..0e10c41ece7 100644 --- a/src/libcore/result.rs +++ b/src/libcore/result.rs @@ -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] |
