File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ impl<E:CLike> EnumSet<E> {
100
100
/// Returns `true` if this `EnumSet` is included in the given `EnumSet`.
101
101
#[ unstable = "matches collection reform specification, waiting for dust to settle" ]
102
102
pub fn is_subset ( & self , other : & EnumSet < E > ) -> bool {
103
- other. is_subset ( self )
103
+ other. is_superset ( self )
104
104
}
105
105
106
106
/// Returns the union of both `EnumSets`.
@@ -302,8 +302,13 @@ mod test {
302
302
e2. insert ( A ) ;
303
303
e2. insert ( B ) ;
304
304
305
- assert ! ( !e1. is_superset( & e2) ) ;
305
+ let mut e3: EnumSet < Foo > = EnumSet :: new ( ) ;
306
+ e3. insert ( C ) ;
307
+
308
+ assert ! ( e1. is_subset( & e2) ) ;
306
309
assert ! ( e2. is_superset( & e1) ) ;
310
+ assert ! ( !e3. is_superset( & e2) )
311
+ assert ! ( !e2. is_superset( & e3) )
307
312
}
308
313
309
314
#[ test]
You can’t perform that action at this time.
0 commit comments