Skip to content

Commit 01b599e

Browse files
committed
Add BitXor to EnumSet.
1 parent 6ee56c9 commit 01b599e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/libcollections/enum_set.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use core::prelude::*;
1717
use core::fmt;
1818

19-
// FIXME(conventions): implement BitXor
2019
// FIXME(contentions): implement union family of methods? (general design may be wrong here)
2120
// FIXME(conventions): implement len
2221

@@ -196,6 +195,12 @@ impl<E:CLike> BitAnd<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
196195
}
197196
}
198197

198+
impl<E:CLike> BitXor<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
199+
fn bitxor(&self, e: &EnumSet<E>) -> EnumSet<E> {
200+
EnumSet {bits: self.bits ^ e.bits}
201+
}
202+
}
203+
199204
/// An iterator over an EnumSet
200205
pub struct Items<E> {
201206
index: uint,

0 commit comments

Comments
 (0)