diff --git a/crates/primitives/src/bits/fixed.rs b/crates/primitives/src/bits/fixed.rs index 09e7ff5bc..d34ae25b7 100644 --- a/crates/primitives/src/bits/fixed.rs +++ b/crates/primitives/src/bits/fixed.rs @@ -303,6 +303,16 @@ impl ops::BitXorAssign for FixedBytes { } } +impl ops::Not for FixedBytes { + type Output = Self; + + #[inline] + fn not(mut self) -> Self::Output { + self.iter_mut().for_each(|byte| *byte = !*byte); + self + } +} + impl str::FromStr for FixedBytes { type Err = hex::FromHexError; diff --git a/crates/primitives/src/bits/macros.rs b/crates/primitives/src/bits/macros.rs index 0f45c7efe..1ba15b352 100644 --- a/crates/primitives/src/bits/macros.rs +++ b/crates/primitives/src/bits/macros.rs @@ -50,6 +50,7 @@ macro_rules! wrap_fixed_bytes { $crate::private::derive_more::BitOrAssign, $crate::private::derive_more::BitXor, $crate::private::derive_more::BitXorAssign, + $crate::private::derive_more::Not, $crate::private::derive_more::Deref, $crate::private::derive_more::DerefMut, $crate::private::derive_more::From,