rollup merge of #23671: steveklabnik/doc_std_clone
This commit is contained in:
@@ -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;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user