Skip to content

Commit ec1bf43

Browse files
committed
more
1 parent d70899d commit ec1bf43

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/sys/flags.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use super::bindings::tsk_flags_t;
55

66
use std::ops::BitAnd;
77
use std::ops::BitOr;
8+
use std::ops::BitXor;
89
use std::ops::BitXorAssign;
910

1011
macro_rules! make_constant_self {
@@ -68,6 +69,13 @@ macro_rules! impl_bit_ops {
6869
}
6970
}
7071

72+
impl BitXor for $type {
73+
type Output = Self;
74+
fn bitxor(self, rhs: Self) -> Self::Output {
75+
Self(self.0 ^ rhs.0)
76+
}
77+
}
78+
7179
impl BitOr for $type {
7280
type Output = Self;
7381
fn bitor(self, rhs: Self) -> Self::Output {

tests/example_flags.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,7 @@ fn test_bit_ops() {
5252
let options = options | SimplificationOptions::REDUCE_TO_SITE_TOPOLOGY;
5353
assert!(!options.contains(SimplificationOptions::KEEP_INPUT_ROOTS));
5454
assert!(options.contains(SimplificationOptions::REDUCE_TO_SITE_TOPOLOGY));
55+
let options = options ^ SimplificationOptions::REDUCE_TO_SITE_TOPOLOGY;
56+
assert!(!options.contains(SimplificationOptions::REDUCE_TO_SITE_TOPOLOGY));
5557
todo!("need to do more of the op traits");
5658
}

0 commit comments

Comments
 (0)