diff --git a/src/utils/boolean_bitfield.rs b/src/utils/boolean_bitfield.rs index fd51bff32..bb7fa79bc 100644 --- a/src/utils/boolean_bitfield.rs +++ b/src/utils/boolean_bitfield.rs @@ -10,6 +10,7 @@ extern crate rlp; use std::cmp::max; use self::rlp::{ RlpStream, Encodable }; +#[derive(Eq)] pub struct BooleanBitfield{ len: usize, vec: Vec @@ -82,6 +83,23 @@ impl BooleanBitfield { } } +impl PartialEq for BooleanBitfield { + fn eq(&self, other: &BooleanBitfield) -> bool { + (self.vec == other.vec) & + (self.len == other.len) + } +} + +impl Clone for BooleanBitfield { + fn clone(&self) -> Self { + Self { + vec: self.vec.to_vec(), + ..*self + } + } +} + + impl Encodable for BooleanBitfield { // TODO: ensure this is a sensible method of encoding // the bitfield. Currently, it is treated as a list of