clone: clarify docstring

This commit is contained in:
Daniel Micay 2013-05-15 00:40:14 -04:00
parent 2fc6b0998b
commit fa45958ec8

View file

@ -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() }