@@ -63,7 +63,9 @@ pub trait ToOwned {
63
63
}
64
64
65
65
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
66
- impl < T > ToOwned for T where T : Clone {
66
+ impl < T > ToOwned for T
67
+ where T : Clone
68
+ {
67
69
type Owned = T ;
68
70
fn to_owned ( & self ) -> T {
69
71
self . clone ( )
@@ -117,17 +119,19 @@ pub enum Cow<'a, B: ?Sized + 'a>
117
119
{
118
120
/// Borrowed data.
119
121
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
120
- Borrowed ( #[ stable( feature = "rust1" , since = "1.0.0" ) ] & ' a B ) ,
122
+ Borrowed ( #[ stable( feature = "rust1" , since = "1.0.0" ) ]
123
+ & ' a B ) ,
121
124
122
125
/// Owned data.
123
126
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
124
- Owned (
125
- #[ stable( feature = "rust1" , since = "1.0.0" ) ] <B as ToOwned >:: Owned
126
- ) ,
127
+ Owned ( #[ stable( feature = "rust1" , since = "1.0.0" ) ]
128
+ <B as ToOwned >:: Owned ) ,
127
129
}
128
130
129
131
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
130
- impl < ' a , B : ?Sized > Clone for Cow < ' a , B > where B : ToOwned {
132
+ impl < ' a , B : ?Sized > Clone for Cow < ' a , B >
133
+ where B : ToOwned
134
+ {
131
135
fn clone ( & self ) -> Cow < ' a , B > {
132
136
match * self {
133
137
Borrowed ( b) => Borrowed ( b) ,
@@ -139,7 +143,9 @@ impl<'a, B: ?Sized> Clone for Cow<'a, B> where B: ToOwned {
139
143
}
140
144
}
141
145
142
- impl < ' a , B : ?Sized > Cow < ' a , B > where B : ToOwned {
146
+ impl < ' a , B : ?Sized > Cow < ' a , B >
147
+ where B : ToOwned
148
+ {
143
149
/// Acquires a mutable reference to the owned form of the data.
144
150
///
145
151
/// Clones the data if it is not already owned.
@@ -194,7 +200,9 @@ impl<'a, B: ?Sized> Cow<'a, B> where B: ToOwned {
194
200
}
195
201
196
202
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
197
- impl < ' a , B : ?Sized > Deref for Cow < ' a , B > where B : ToOwned {
203
+ impl < ' a , B : ?Sized > Deref for Cow < ' a , B >
204
+ where B : ToOwned
205
+ {
198
206
type Target = B ;
199
207
200
208
fn deref ( & self ) -> & B {
@@ -209,7 +217,9 @@ impl<'a, B: ?Sized> Deref for Cow<'a, B> where B: ToOwned {
209
217
impl < ' a , B : ?Sized > Eq for Cow < ' a , B > where B : Eq + ToOwned { }
210
218
211
219
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
212
- impl < ' a , B : ?Sized > Ord for Cow < ' a , B > where B : Ord + ToOwned {
220
+ impl < ' a , B : ?Sized > Ord for Cow < ' a , B >
221
+ where B : Ord + ToOwned
222
+ {
213
223
#[ inline]
214
224
fn cmp ( & self , other : & Cow < ' a , B > ) -> Ordering {
215
225
Ord :: cmp ( & * * self , & * * other)
@@ -228,7 +238,9 @@ impl<'a, 'b, B: ?Sized, C: ?Sized> PartialEq<Cow<'b, C>> for Cow<'a, B>
228
238
}
229
239
230
240
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
231
- impl < ' a , B : ?Sized > PartialOrd for Cow < ' a , B > where B : PartialOrd + ToOwned {
241
+ impl < ' a , B : ?Sized > PartialOrd for Cow < ' a , B >
242
+ where B : PartialOrd + ToOwned
243
+ {
232
244
#[ inline]
233
245
fn partial_cmp ( & self , other : & Cow < ' a , B > ) -> Option < Ordering > {
234
246
PartialOrd :: partial_cmp ( & * * self , & * * other)
@@ -273,7 +285,9 @@ impl<'a, B: ?Sized> Default for Cow<'a, B>
273
285
}
274
286
275
287
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
276
- impl < ' a , B : ?Sized > Hash for Cow < ' a , B > where B : Hash + ToOwned {
288
+ impl < ' a , B : ?Sized > Hash for Cow < ' a , B >
289
+ where B : Hash + ToOwned
290
+ {
277
291
#[ inline]
278
292
fn hash < H : Hasher > ( & self , state : & mut H ) {
279
293
Hash :: hash ( & * * self , state)
0 commit comments