File tree Expand file tree Collapse file tree 2 files changed +23
-5
lines changed
branches/snap-stage3/src/libcore Expand file tree Collapse file tree 2 files changed +23
-5
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: e430a699f2c60890d9b86069fd0c68a70ece7120
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
- refs/heads/snap-stage3: f35abae89281cd54073c7caefd1e7d55123e8b6d
4
+ refs/heads/snap-stage3: 8e7fb8e8f5c7175bb18e38c266de3ccce16189bb
5
5
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
Original file line number Diff line number Diff line change @@ -279,16 +279,34 @@ mod linear {
279
279
}
280
280
}
281
281
282
- /*
283
- FIXME --- #2979 must be fixed to typecheck this
284
282
impl imm_methods < K , V > for & linear_map < K , V > {
283
+ /*
284
+ FIXME --- #2979 must be fixed to typecheck this
285
285
fn find_ptr(k: K) -> option<&V> {
286
286
//XXX this should not type check as written, but it should
287
287
//be *possible* to typecheck it...
288
288
self.with_ptr(k, |v| v)
289
289
}
290
+ */
291
+
292
+ fn each ( blk : fn ( k : & K , v : & V ) -> bool ) {
293
+ for vec:: each( self . buckets) |slot| {
294
+ let mut broke = false ;
295
+ do slot. iter |bucket| {
296
+ if !blk ( & bucket. key , & bucket. value ) {
297
+ broke = true ; // FIXME(#3064) just write "break;"
298
+ }
299
+ }
300
+ if broke { break ; }
301
+ }
302
+ }
303
+ fn each_key ( blk : fn ( k : & K ) -> bool ) {
304
+ self . each ( |k, _v| blk ( k) )
305
+ }
306
+ fn each_value ( blk : fn ( v : & V ) -> bool ) {
307
+ self . each ( |_k, v| blk ( v) )
308
+ }
290
309
}
291
- */
292
310
}
293
311
294
312
#[ test]
@@ -342,4 +360,4 @@ mod test {
342
360
assert m. get ( & 9 ) == 4 ;
343
361
assert m. get ( & 5 ) == 3 ;
344
362
}
345
- }
363
+ }
You can’t perform that action at this time.
0 commit comments