We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 65805bf commit 2655abdCopy full SHA for 2655abd
src/libcollections/enum_set.rs
@@ -100,7 +100,7 @@ impl<E:CLike> EnumSet<E> {
100
/// Returns `true` if this `EnumSet` is included in the given `EnumSet`.
101
#[unstable = "matches collection reform specification, waiting for dust to settle"]
102
pub fn is_subset(&self, other: &EnumSet<E>) -> bool {
103
- other.is_subset(self)
+ other.is_superset(self)
104
}
105
106
/// Returns the union of both `EnumSets`.
@@ -302,8 +302,13 @@ mod test {
302
e2.insert(A);
303
e2.insert(B);
304
305
- assert!(!e1.is_superset(&e2));
+ let mut e3: EnumSet<Foo> = EnumSet::new();
306
+ e3.insert(C);
307
+
308
+ assert!(e1.is_subset(&e2));
309
assert!(e2.is_superset(&e1));
310
+ assert!(!e3.is_superset(&e2))
311
+ assert!(!e2.is_superset(&e3))
312
313
314
#[test]
0 commit comments