@@ -30,31 +30,15 @@ pub trait Map<K, V>: Mutable {
30
30
fn contains_key ( & self , key : & K ) -> bool ;
31
31
32
32
// Visits all keys and values
33
- #[ cfg( stage0) ]
34
- fn each < ' a > ( & ' a self , f : & fn ( & K , & ' a V ) -> bool ) ;
35
- // Visits all keys and values
36
- #[ cfg( not( stage0) ) ]
37
33
fn each < ' a > ( & ' a self , f : & fn ( & K , & ' a V ) -> bool ) -> bool ;
38
34
39
35
/// Visit all keys
40
- #[ cfg( stage0) ]
41
- fn each_key ( & self , f : & fn ( & K ) -> bool ) ;
42
- /// Visit all keys
43
- #[ cfg( not( stage0) ) ]
44
36
fn each_key ( & self , f : & fn ( & K ) -> bool ) -> bool ;
45
37
46
38
/// Visit all values
47
- #[ cfg( stage0) ]
48
- fn each_value < ' a > ( & ' a self , f : & fn ( & ' a V ) -> bool ) ;
49
- /// Visit all values
50
- #[ cfg( not( stage0) ) ]
51
39
fn each_value < ' a > ( & ' a self , f : & fn ( & ' a V ) -> bool ) -> bool ;
52
40
53
41
/// Iterate over the map and mutate the contained values
54
- #[ cfg( stage0) ]
55
- fn mutate_values ( & mut self , f : & fn ( & K , & mut V ) -> bool ) ;
56
- /// Iterate over the map and mutate the contained values
57
- #[ cfg( not( stage0) ) ]
58
42
fn mutate_values ( & mut self , f : & fn ( & K , & mut V ) -> bool ) -> bool ;
59
43
60
44
/// Return a reference to the value corresponding to the key
@@ -81,43 +65,6 @@ pub trait Map<K, V>: Mutable {
81
65
fn pop ( & mut self , k : & K ) -> Option < V > ;
82
66
}
83
67
84
- #[ cfg( stage0) ]
85
- pub trait Set < T > : Mutable {
86
- /// Return true if the set contains a value
87
- fn contains ( & self , value : & T ) -> bool ;
88
-
89
- /// Add a value to the set. Return true if the value was not already
90
- /// present in the set.
91
- fn insert ( & mut self , value : T ) -> bool ;
92
-
93
- /// Remove a value from the set. Return true if the value was
94
- /// present in the set.
95
- fn remove ( & mut self , value : & T ) -> bool ;
96
-
97
- /// Return true if the set has no elements in common with `other`.
98
- /// This is equivalent to checking for an empty intersection.
99
- fn is_disjoint ( & self , other : & Self ) -> bool ;
100
-
101
- /// Return true if the set is a subset of another
102
- fn is_subset ( & self , other : & Self ) -> bool ;
103
-
104
- /// Return true if the set is a superset of another
105
- fn is_superset ( & self , other : & Self ) -> bool ;
106
-
107
- /// Visit the values representing the difference
108
- fn difference ( & self , other : & Self , f : & fn ( & T ) -> bool ) ;
109
-
110
- /// Visit the values representing the symmetric difference
111
- fn symmetric_difference ( & self , other : & Self , f : & fn ( & T ) -> bool ) ;
112
-
113
- /// Visit the values representing the intersection
114
- fn intersection ( & self , other : & Self , f : & fn ( & T ) -> bool ) ;
115
-
116
- /// Visit the values representing the union
117
- fn union ( & self , other : & Self , f : & fn ( & T ) -> bool ) ;
118
- }
119
-
120
- #[ cfg( not( stage0) ) ]
121
68
pub trait Set < T > : Mutable {
122
69
/// Return true if the set contains a value
123
70
fn contains ( & self , value : & T ) -> bool ;
0 commit comments