@@ -39,7 +39,7 @@ use self::Cow::*;
39
39
/// Borrow<Vec<T>>` and `Vec<T>: Borrow<[T]>`.
40
40
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
41
41
pub trait Borrow < Borrowed : ?Sized > {
42
- /// Immutably borrow from an owned value.
42
+ /// Immutably borrows from an owned value.
43
43
///
44
44
/// # Examples
45
45
///
@@ -67,7 +67,7 @@ pub trait Borrow<Borrowed: ?Sized> {
67
67
/// Similar to `Borrow`, but for mutable borrows.
68
68
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
69
69
pub trait BorrowMut < Borrowed : ?Sized > : Borrow < Borrowed > {
70
- /// Mutably borrow from an owned value.
70
+ /// Mutably borrows from an owned value.
71
71
///
72
72
/// # Examples
73
73
///
@@ -126,7 +126,7 @@ impl<'a, B: ?Sized> Borrow<B> for Cow<'a, B> where B: ToOwned, <B as ToOwned>::O
126
126
}
127
127
}
128
128
129
- /// A generalization of Clone to borrowed data.
129
+ /// A generalization of ` Clone` to borrowed data.
130
130
///
131
131
/// Some types make it possible to go from borrowed to owned, usually by
132
132
/// implementing the `Clone` trait. But `Clone` works only for going from `&T`
@@ -137,7 +137,7 @@ pub trait ToOwned {
137
137
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
138
138
type Owned : Borrow < Self > ;
139
139
140
- /// Create owned data from borrowed data, usually by copying .
140
+ /// Creates owned data from borrowed data, usually by cloning .
141
141
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
142
142
fn to_owned ( & self ) -> Self :: Owned ;
143
143
}
@@ -155,9 +155,9 @@ impl<T> ToOwned for T where T: Clone {
155
155
/// data lazily when mutation or ownership is required. The type is designed to
156
156
/// work with general borrowed data via the `Borrow` trait.
157
157
///
158
- /// `Cow` implements both `Deref`, which means that you can call
158
+ /// `Cow` implements `Deref`, which means that you can call
159
159
/// non-mutating methods directly on the data it encloses. If mutation
160
- /// is desired, `to_mut` will obtain a mutable references to an owned
160
+ /// is desired, `to_mut` will obtain a mutable reference to an owned
161
161
/// value, cloning if necessary.
162
162
///
163
163
/// # Examples
@@ -200,7 +200,7 @@ impl<'a, B: ?Sized> Clone for Cow<'a, B> where B: ToOwned {
200
200
}
201
201
202
202
impl < ' a , B : ?Sized > Cow < ' a , B > where B : ToOwned {
203
- /// Acquire a mutable reference to the owned form of the data.
203
+ /// Acquires a mutable reference to the owned form of the data.
204
204
///
205
205
/// Copies the data if it is not already owned.
206
206
///
@@ -226,7 +226,7 @@ impl<'a, B: ?Sized> Cow<'a, B> where B: ToOwned {
226
226
}
227
227
}
228
228
229
- /// Extract the owned data.
229
+ /// Extracts the owned data.
230
230
///
231
231
/// Copies the data if it is not already owned.
232
232
///
@@ -327,7 +327,7 @@ impl<'a, B: ?Sized> Hash for Cow<'a, B> where B: Hash + ToOwned
327
327
}
328
328
}
329
329
330
- /// Trait for moving into a `Cow`
330
+ /// Trait for moving into a `Cow`.
331
331
#[ unstable( feature = "into_cow" , reason = "may be replaced by `convert::Into`" ) ]
332
332
pub trait IntoCow < ' a , B : ?Sized > where B : ToOwned {
333
333
/// Moves `self` into `Cow`
0 commit comments