@@ -1358,7 +1358,7 @@ pub pure fn each<T>(v: &r/[T], f: &fn(&r/T) -> bool) {
1358
1358
/// a vector with mutable contents and you would like
1359
1359
/// to mutate the contents as you iterate.
1360
1360
#[ inline( always) ]
1361
- pub fn each_mut < T > ( v : & mut [ T ] , f : & fn ( elem : & mut T ) -> bool ) {
1361
+ pub fn each_mut < T > ( v : & ' r mut [ T ] , f : & fn ( elem : & ' r mut T ) -> bool ) {
1362
1362
let mut i = 0 ;
1363
1363
let n = v. len ( ) ;
1364
1364
while i < n {
@@ -2282,11 +2282,9 @@ pub mod bytes {
2282
2282
// ___________________________________________________________________________
2283
2283
// ITERATION TRAIT METHODS
2284
2284
2285
- impl < A > iter:: BaseIter < A > for & self / [ A ] {
2285
+ impl < A > iter:: BaseIter < A > for & ' self [ A ] {
2286
2286
#[ inline( always) ]
2287
- pub pure fn each ( & self , blk : & fn ( v : & ' self A ) -> bool ) {
2288
- each ( * self , blk)
2289
- }
2287
+ pure fn each ( & self , blk : & fn ( v : & ' self A ) -> bool ) { each ( * self , blk) }
2290
2288
#[ inline( always) ]
2291
2289
pure fn size_hint ( & self ) -> Option < uint > { Some ( self . len ( ) ) }
2292
2290
}
@@ -2307,6 +2305,29 @@ impl<A> iter::BaseIter<A> for @[A] {
2307
2305
pure fn size_hint ( & self ) -> Option < uint > { Some ( self . len ( ) ) }
2308
2306
}
2309
2307
2308
+ impl < A > iter:: MutableIter < A > for & ' self mut [ A ] {
2309
+ #[ inline( always) ]
2310
+ fn each_mut ( & mut self , blk : & fn ( v : & ' self mut A ) -> bool ) {
2311
+ each_mut ( * self , blk)
2312
+ }
2313
+ }
2314
+
2315
+ // FIXME(#4148): This should be redundant
2316
+ impl < A > iter:: MutableIter < A > for ~[ A ] {
2317
+ #[ inline( always) ]
2318
+ fn each_mut ( & mut self , blk : & fn ( v : & ' self mut A ) -> bool ) {
2319
+ each_mut ( * self , blk)
2320
+ }
2321
+ }
2322
+
2323
+ // FIXME(#4148): This should be redundant
2324
+ impl < A > iter:: MutableIter < A > for @mut [ A ] {
2325
+ #[ inline( always) ]
2326
+ fn each_mut ( & mut self , blk : & fn ( v : & mut A ) -> bool ) {
2327
+ each_mut ( * self , blk)
2328
+ }
2329
+ }
2330
+
2310
2331
impl < A > iter:: ExtendedIter < A > for & self /[ A ] {
2311
2332
pub pure fn eachi ( & self , blk : & fn ( uint , v : & A ) -> bool ) {
2312
2333
iter:: eachi ( self , blk)
0 commit comments