diff options
| author | Steve Klabnik <steve@steveklabnik.com> | 2015-03-24 16:58:08 -0400 |
|---|---|---|
| committer | Steve Klabnik <steve@steveklabnik.com> | 2015-03-24 16:58:08 -0400 |
| commit | 406524682bc54e821b78dc0ef5a30e6294d9997d (patch) | |
| tree | bab4acd9890964690d249450c27b9d895052d04c | |
| parent | 28a0b25f424090255966273994748a9f9901059f (diff) | |
| download | rust-406524682bc54e821b78dc0ef5a30e6294d9997d.tar.gz rust-406524682bc54e821b78dc0ef5a30e6294d9997d.zip | |
An example for clone
| -rw-r--r-- | src/libcore/clone.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libcore/clone.rs b/src/libcore/clone.rs index 058eff121e6..85e5bde4859 100644 --- a/src/libcore/clone.rs +++ b/src/libcore/clone.rs @@ -27,6 +27,14 @@ use marker::Sized; #[stable(feature = "rust1", since = "1.0.0")] pub trait Clone : Sized { /// 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")] fn clone(&self) -> Self; |
