Skip to content

Commit fb1ef4f

Browse files
Make Result's unwrap_or_default unstable
1 parent 1c2151b commit fb1ef4f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/libcore/result.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -802,8 +802,8 @@ impl<T: Default, E> Result<T, E> {
802802
/// # Examples
803803
///
804804
/// Convert a string to an integer, turning poorly-formed strings
805-
/// into 0 (the default value for integers). `parse` converts
806-
/// a string to any other type that implements `FromStr`, returning an
805+
/// into 0 (the default value for integers). [`parse`] converts
806+
/// a string to any other type that implements [`FromStr`], returning an
807807
/// `Err` on error.
808808
///
809809
/// ```
@@ -814,9 +814,12 @@ impl<T: Default, E> Result<T, E> {
814814
///
815815
/// assert_eq!(1909, good_year);
816816
/// assert_eq!(0, bad_year);
817+
///
818+
/// [`parse`]: ../../std/primitive.str.html#method.parse
819+
/// [`FromStr`]: ../../std/str/trait.FromStr.html
817820
/// ```
818821
#[inline]
819-
#[stable(feature = "rust1", since = "1.0.0")]
822+
#[unstable(feature = "result_unwrap_or_default", issue = "0")]
820823
pub fn unwrap_or_default(self) -> T {
821824
match self {
822825
Ok(x) => x,

0 commit comments

Comments
 (0)