Skip to content

Commit

Permalink
Add BitXor to EnumSet.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbcrail committed Nov 7, 2014
1 parent 6ee56c9 commit 01b599e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/libcollections/enum_set.rs
Expand Up @@ -16,7 +16,6 @@
use core::prelude::*;
use core::fmt;

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

Expand Down Expand Up @@ -196,6 +195,12 @@ impl<E:CLike> BitAnd<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
}
}

impl<E:CLike> BitXor<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
fn bitxor(&self, e: &EnumSet<E>) -> EnumSet<E> {
EnumSet {bits: self.bits ^ e.bits}
}
}

/// An iterator over an EnumSet
pub struct Items<E> {
index: uint,
Expand Down

0 comments on commit 01b599e

Please sign in to comment.