diff options
| author | Devon Hollowood <devonhollowood@gmail.com> | 2016-10-20 23:50:33 -0700 |
|---|---|---|
| committer | Devon Hollowood <devonhollowood@gmail.com> | 2016-10-20 23:50:33 -0700 |
| commit | fb1ef4f42c0aefa3f92b3f81ad4f24bdcb0b1753 (patch) | |
| tree | 9ef450fdb7253839fc279b87d8c5d1ee9510b8a2 /src/libcore | |
| parent | 1c2151b7f9b460cda4a028f7ad031d9dae3f5913 (diff) | |
| download | rust-fb1ef4f42c0aefa3f92b3f81ad4f24bdcb0b1753.tar.gz rust-fb1ef4f42c0aefa3f92b3f81ad4f24bdcb0b1753.zip | |
Make `Result`'s `unwrap_or_default` unstable
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/result.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libcore/result.rs b/src/libcore/result.rs index 8964b29b3a6..f4973b3a254 100644 --- a/src/libcore/result.rs +++ b/src/libcore/result.rs @@ -802,8 +802,8 @@ impl<T: Default, E> Result<T, E> { /// # Examples /// /// Convert a string to an integer, turning poorly-formed strings - /// into 0 (the default value for integers). `parse` converts - /// a string to any other type that implements `FromStr`, returning an + /// into 0 (the default value for integers). [`parse`] converts + /// a string to any other type that implements [`FromStr`], returning an /// `Err` on error. /// /// ``` @@ -814,9 +814,12 @@ impl<T: Default, E> Result<T, E> { /// /// assert_eq!(1909, good_year); /// assert_eq!(0, bad_year); + /// + /// [`parse`]: ../../std/primitive.str.html#method.parse + /// [`FromStr`]: ../../std/str/trait.FromStr.html /// ``` #[inline] - #[stable(feature = "rust1", since = "1.0.0")] + #[unstable(feature = "result_unwrap_or_default", issue = "0")] pub fn unwrap_or_default(self) -> T { match self { Ok(x) => x, |
