We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Cow::into_owned
1 parent 6421a49 commit 9f4934eCopy full SHA for 9f4934e
library/alloc/src/borrow.rs
@@ -292,8 +292,7 @@ impl<B: ?Sized + ToOwned> Cow<'_, B> {
292
///
293
/// # Examples
294
295
- /// Calling `into_owned` on a `Cow::Borrowed` clones the underlying data
296
- /// and becomes a `Cow::Owned`:
+ /// Calling `into_owned` on a `Cow::Borrowed` returns a clone of the borrowed data:
297
298
/// ```
299
/// use std::borrow::Cow;
@@ -307,7 +306,8 @@ impl<B: ?Sized + ToOwned> Cow<'_, B> {
307
306
/// );
308
309
310
- /// Calling `into_owned` on a `Cow::Owned` is a no-op:
+ /// Calling `into_owned` on a `Cow::Owned` returns the owned data. The data is moved out of the
+ /// `Cow` without being cloned.
311
312
313
0 commit comments