rollup merge of #23671: steveklabnik/doc_std_clone
This commit is contained in:
commit
19cd00094c
1 changed files with 8 additions and 0 deletions
|
@ -27,6 +27,14 @@ use marker::Sized;
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
pub trait Clone : Sized {
|
pub trait Clone : Sized {
|
||||||
/// Returns a copy of the value.
|
/// Returns a copy of the value.
|
||||||
|
///
|
||||||
|
/// # Examples
|
||||||
|
///
|
||||||
|
/// ```
|
||||||
|
/// let hello = "Hello"; // &str implements Clone
|
||||||
|
///
|
||||||
|
/// assert_eq!("Hello", hello.clone());
|
||||||
|
/// ```
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
fn clone(&self) -> Self;
|
fn clone(&self) -> Self;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue