Make Result's unwrap_or_default unstable

This commit is contained in:
Devon Hollowood 2016-10-20 23:50:33 -07:00
parent 1c2151b7f9
commit fb1ef4f42c

View File

@ -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,