@@ -2268,45 +2268,27 @@ pub mod bytes {
2268
2268
2269
2269
// ___________________________________________________________________________
2270
2270
// ITERATION TRAIT METHODS
2271
- //
2272
- // This cannot be used with iter-trait.rs because of the region pointer
2273
- // required in the slice.
2274
2271
2275
2272
impl < A > iter:: BaseIter < A > for & self /[ A ] {
2276
- pub pure fn each ( & self , blk : fn ( v : & A ) -> bool ) {
2277
- // FIXME(#2263)---should be able to call each(self, blk)
2278
- for each( * self ) |e| {
2279
- if ( !blk ( e) ) {
2280
- return ;
2281
- }
2282
- }
2283
- }
2273
+ #[ inline( always) ]
2274
+ pure fn each ( & self , blk : fn ( v : & ' self A ) -> bool ) { each ( * self , blk) }
2275
+ #[ inline( always) ]
2284
2276
pure fn size_hint ( & self ) -> Option < uint > { Some ( len ( * self ) ) }
2285
2277
}
2286
2278
2287
2279
// FIXME(#4148): This should be redundant
2288
2280
impl < A > iter:: BaseIter < A > for ~[ A ] {
2289
- pub pure fn each ( & self , blk : fn ( v : & A ) -> bool ) {
2290
- // FIXME(#2263)---should be able to call each(self, blk)
2291
- for each( * self ) |e| {
2292
- if ( !blk ( e) ) {
2293
- return ;
2294
- }
2295
- }
2296
- }
2281
+ #[ inline( always) ]
2282
+ pure fn each ( & self , blk : fn ( v : & ' self A ) -> bool ) { each ( * self , blk) }
2283
+ #[ inline( always) ]
2297
2284
pure fn size_hint ( & self ) -> Option < uint > { Some ( len ( * self ) ) }
2298
2285
}
2299
2286
2300
2287
// FIXME(#4148): This should be redundant
2301
2288
impl < A > iter:: BaseIter < A > for @[ A ] {
2302
- pub pure fn each ( & self , blk : fn ( v : & A ) -> bool ) {
2303
- // FIXME(#2263)---should be able to call each(self, blk)
2304
- for each( * self ) |e| {
2305
- if ( !blk ( e) ) {
2306
- return ;
2307
- }
2308
- }
2309
- }
2289
+ #[ inline( always) ]
2290
+ pure fn each ( & self , blk : fn ( v : & ' self A ) -> bool ) { each ( * self , blk) }
2291
+ #[ inline( always) ]
2310
2292
pure fn size_hint ( & self ) -> Option < uint > { Some ( len ( * self ) ) }
2311
2293
}
2312
2294
0 commit comments