Skip to content

Commit

Permalink
Delete custom impls
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsproul committed Nov 15, 2024
1 parent 83a8a28 commit 293ca9f
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions ssz/src/bitfield.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ pub type BitVector<N> = Bitfield<Fixed<N>>;
/// The internal representation of the bitfield is the same as that required by SSZ. The lowest
/// byte (by `Vec` index) stores the lowest bit-indices and the right-most bit stores the lowest
/// bit-index. E.g., `smallvec![0b0000_0001, 0b0000_0010]` has bits `0, 9` set.
#[derive(Clone, Debug)]
#[derive(Clone, PartialEq, Eq, Hash, Debug)]
pub struct Bitfield<T> {
bytes: SmallVec<[u8; SMALLVEC_LEN]>,
len: usize,
Expand Down Expand Up @@ -544,22 +544,6 @@ impl<T: BitfieldBehaviour> Bitfield<T> {
}
}

impl<T> Eq for Bitfield<T> {}
impl<T> PartialEq for Bitfield<T> {
#[inline]
fn eq(&self, other: &Bitfield<T>) -> bool {
self.len == other.len && self.bytes == other.bytes
}
}

impl<T> core::hash::Hash for Bitfield<T> {
#[inline]
fn hash<H: core::hash::Hasher>(&self, state: &mut H) {
core::hash::Hash::hash(&self.bytes, state);
core::hash::Hash::hash(&self.len, state);
}
}

/// Returns the minimum required bytes to represent a given number of bits.
///
/// `bit_len == 0` requires a single byte.
Expand Down

0 comments on commit 293ca9f

Please sign in to comment.