File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
branches/snap-stage3/src/libstd Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: 09bb07bed9166105ea961a42b5fff7739ae0d2e9
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
- refs/heads/snap-stage3: 1b4eb145f92e7630b7e5733847d29985c3bd215f
4
+ refs/heads/snap-stage3: 643479f2e54913a6e16449742bdf023f6a753380
5
5
refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
Original file line number Diff line number Diff line change @@ -167,6 +167,13 @@ pub mod chained {
167
167
pure fn is_empty ( & self ) -> bool { self . count == 0 }
168
168
}
169
169
170
+ impl < K : Eq IterBytes Hash , V > T < K , V > : Mutable {
171
+ fn clear ( & mut self ) {
172
+ self . count = 0 u;
173
+ self . chains = chains ( initial_capacity) ;
174
+ }
175
+ }
176
+
170
177
impl < K : Eq IterBytes Hash Copy , V : Copy > T < K , V > {
171
178
pure fn contains_key_ref ( k : & K ) -> bool {
172
179
let hash = k. hash_keyed ( 0 , 0 ) as uint ;
@@ -309,11 +316,6 @@ pub mod chained {
309
316
}
310
317
}
311
318
312
- fn clear ( ) {
313
- self . count = 0 u;
314
- self . chains = chains ( initial_capacity) ;
315
- }
316
-
317
319
pure fn each ( blk : fn ( key : K , value : V ) -> bool ) {
318
320
self . each_ref ( |k, v| blk ( * k, * v) )
319
321
}
@@ -655,7 +657,7 @@ mod tests {
655
657
#[ test]
656
658
fn test_clear ( ) {
657
659
let key = ~"k";
658
- let map = HashMap :: < ~str , ~str > ( ) ;
660
+ let mut map = HashMap :: < ~str , ~str > ( ) ;
659
661
map. insert ( key, ~"val") ;
660
662
assert ( map. len ( ) == 1 ) ;
661
663
assert ( map. contains_key_ref ( & key) ) ;
You can’t perform that action at this time.
0 commit comments