Make macro compatible with more recent version of Rust
This commit is contained in:
parent
5d49abcf62
commit
506ef75e3c
@ -75,7 +75,7 @@ macro_rules! mirror_match {
|
|||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
($e:expr { $($arms:tt)* }) => {
|
(($e:expr) { $($arms:tt)* }) => {
|
||||||
mirror_match!(@parse $e, (); $($arms)*)
|
mirror_match!(@parse $e, (); $($arms)*)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -275,7 +275,7 @@ impl Bit {
|
|||||||
|
|
||||||
// self xor other
|
// self xor other
|
||||||
pub fn xor(&self, other: &Bit) -> Bit {
|
pub fn xor(&self, other: &Bit) -> Bit {
|
||||||
mirror_match!((self, other) {
|
mirror_match!(((self, other)) {
|
||||||
(&Constant(a), &Constant(b)) => {
|
(&Constant(a), &Constant(b)) => {
|
||||||
Constant(a != b)
|
Constant(a != b)
|
||||||
},
|
},
|
||||||
@ -326,7 +326,7 @@ impl Bit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn and(&self, other: &Bit) -> Bit {
|
pub fn and(&self, other: &Bit) -> Bit {
|
||||||
mirror_match!((self, other) {
|
mirror_match!(((self, other)) {
|
||||||
(&Constant(a), &Constant(b)) => {
|
(&Constant(a), &Constant(b)) => {
|
||||||
Constant(a && b)
|
Constant(a && b)
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user