We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7fd331e commit 6fee337Copy full SHA for 6fee337
src/libcollections/borrow.rs
@@ -49,6 +49,18 @@ pub trait ToOwned {
49
type Owned: Borrow<Self>;
50
51
/// Creates owned data from borrowed data, usually by cloning.
52
+ ///
53
+ /// # Examples
54
55
+ /// Basic usage:
56
57
+ /// ```
58
+ /// let s = "a"; // &str
59
+ /// let ss = s.to_owned(); // String
60
61
+ /// let v = &[1, 2]; // slice
62
+ /// let vv = v.to_owned(); // Vec
63
64
#[stable(feature = "rust1", since = "1.0.0")]
65
fn to_owned(&self) -> Self::Owned;
66
}
0 commit comments