clone: clarify docstring
This commit is contained in:
parent
2fc6b0998b
commit
fa45958ec8
1 changed files with 3 additions and 2 deletions
|
@ -23,7 +23,8 @@ by convention implementing the `Clone` trait and calling the
|
||||||
*/
|
*/
|
||||||
|
|
||||||
pub trait Clone {
|
pub trait Clone {
|
||||||
/// Return a deep copy of the owned object tree. Managed boxes are cloned with a shallow copy.
|
/// Return a deep copy of the owned object tree. Types with shared ownership like managed boxes
|
||||||
|
/// are cloned with a shallow copy.
|
||||||
fn clone(&self) -> Self;
|
fn clone(&self) -> Self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +34,7 @@ impl Clone for () {
|
||||||
fn clone(&self) -> () { () }
|
fn clone(&self) -> () { () }
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T:Clone> Clone for ~T {
|
impl<T: Clone> Clone for ~T {
|
||||||
/// Return a deep copy of the owned box.
|
/// Return a deep copy of the owned box.
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn clone(&self) -> ~T { ~(**self).clone() }
|
fn clone(&self) -> ~T { ~(**self).clone() }
|
||||||
|
|
Loading…
Reference in a new issue