@@ -28,84 +28,6 @@ pub type Set<K> = HashMap<K, ()>;
28
28
29
29
pub type HashMap < K , V > = chained:: T < K , V > ;
30
30
31
- pub trait StdMap < K : Eq IterBytes Hash Copy , V : Copy > {
32
- /// Return the number of elements in the map
33
- pure fn size ( ) -> uint ;
34
-
35
- /**
36
- * Add a value to the map.
37
- *
38
- * If the map already contains a value for the specified key then the
39
- * original value is replaced.
40
- *
41
- * Returns true if the key did not already exist in the map
42
- */
43
- fn insert ( key : K , value : V ) -> bool ;
44
-
45
- /**
46
- * Add a value to the map.
47
- *
48
- * If the map contains a value for the key, use the function
49
- * to set a new value.
50
- */
51
- fn update_with_key ( key : K , newval : V , ff : fn ( K , V , V ) -> V ) -> bool ;
52
-
53
- /**
54
- * Add a value to the map.
55
- *
56
- * If the map contains a value for the key, use the function to
57
- * set a new value. (Like `update_with_key`, but with a
58
- * function of only values.)
59
- */
60
- fn update ( key : K , newval : V , ff : fn ( V , V ) -> V ) -> bool ;
61
-
62
- /// Returns true if the map contains a value for the specified key
63
- pure fn contains_key ( key : K ) -> bool ;
64
-
65
- /// Returns true if the map contains a value for the specified
66
- /// key, taking the key by reference.
67
- pure fn contains_key_ref ( key : & K ) -> bool ;
68
-
69
- /**
70
- * Get the value for the specified key. Fails if the key does not exist in
71
- * the map.
72
- */
73
- pure fn get ( key : K ) -> V ;
74
-
75
- /**
76
- * Get the value for the specified key. If the key does not exist in
77
- * the map then returns none.
78
- */
79
- pure fn find ( key : K ) -> Option < V > ;
80
-
81
- /**
82
- * Remove and return a value from the map. Returns true if the
83
- * key was present in the map, otherwise false.
84
- */
85
- fn remove ( key : K ) -> bool ;
86
-
87
- /// Clear the map, removing all key/value pairs.
88
- fn clear ( ) ;
89
-
90
- /// Iterate over all the key/value pairs in the map by value
91
- pure fn each ( fn ( key : K , value : V ) -> bool ) ;
92
-
93
- /// Iterate over all the keys in the map by value
94
- pure fn each_key ( fn ( key : K ) -> bool ) ;
95
-
96
- /// Iterate over all the values in the map by value
97
- pure fn each_value ( fn ( value : V ) -> bool ) ;
98
-
99
- /// Iterate over all the key/value pairs in the map by reference
100
- pure fn each_ref ( fn ( key : & K , value : & V ) -> bool ) ;
101
-
102
- /// Iterate over all the keys in the map by reference
103
- pure fn each_key_ref ( fn ( key : & K ) -> bool ) ;
104
-
105
- /// Iterate over all the values in the map by reference
106
- pure fn each_value_ref ( fn ( value : & V ) -> bool ) ;
107
- }
108
-
109
31
pub mod util {
110
32
pub struct Rational {
111
33
// : int::positive(*.den);
@@ -124,7 +46,7 @@ pub mod util {
124
46
// FIXME (#2344): package this up and export it as a datatype usable for
125
47
// external code that doesn't want to pay the cost of a box.
126
48
pub mod chained {
127
- use map:: { StdMap , util} ;
49
+ use map:: util;
128
50
129
51
use core:: io;
130
52
use core:: ops;
@@ -239,7 +161,7 @@ pub mod chained {
239
161
}
240
162
}
241
163
242
- impl < K : Eq IterBytes Hash Copy , V : Copy > T < K , V > : StdMap < K , V > {
164
+ impl < K : Eq IterBytes Hash Copy , V : Copy > T < K , V > {
243
165
pure fn size ( ) -> uint { self . count }
244
166
245
167
pure fn contains_key ( k : K ) -> bool {
0 commit comments