Skip to content

Commit

Permalink
Rollup merge of rust-lang#45993 - QuietMisdreavus:anti-cow, r=kennytm
Browse files Browse the repository at this point in the history
examples in Cow::into_owned don't need to wrap result in Cows

This totally confused me until i triple-checked the actual return value and opened the examples in the playground myself.

r? @rust-lang/docs
  • Loading branch information
GuillaumeGomez authored Nov 16, 2017
2 parents ed64b97 + 479b919 commit 8debe61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/liballoc/borrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ impl<'a, B: ?Sized> Cow<'a, B>
///
/// assert_eq!(
/// cow.into_owned(),
/// Cow::Owned(String::from(s))
/// String::from(s)
/// );
/// ```
///
Expand All @@ -246,7 +246,7 @@ impl<'a, B: ?Sized> Cow<'a, B>
///
/// assert_eq!(
/// cow.into_owned(),
/// Cow::Owned(String::from(s))
/// String::from(s)
/// );
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down

0 comments on commit 8debe61

Please sign in to comment.