Merge rust-bitcoin/rust-secp256k1#528: fix formatting on master

c0ae3e7d35 fix formatting on master (Andrew Poelstra)

Pull request description:

  Looks like I need to check formatting now before merging things :) master CI is broken because of cargo fmt.

ACKs for top commit:
  tcharding:
    ACK  c0ae3e7d35

Tree-SHA512: 9dc22eb5edfb565309cfd14cb9634abba196e46591da8c21d241bd686df8436a8af371c6520ea6ae688fcf81a835919a1bc9a3730f206ba6ef758087efa282e1
This commit is contained in:
Andrew Poelstra 2022-11-22 23:59:30 +00:00
commit 4864a33a62
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
1 changed files with 1 additions and 2 deletions

View File

@ -71,8 +71,7 @@ impl PartialEq for SecretKey {
/// This implementation is designed to be constant time to help prevent side channel attacks. /// This implementation is designed to be constant time to help prevent side channel attacks.
#[inline] #[inline]
fn eq(&self, other: &Self) -> bool { fn eq(&self, other: &Self) -> bool {
let accum = self.0.iter().zip(&other.0) let accum = self.0.iter().zip(&other.0).fold(0, |accum, (a, b)| accum | a ^ b);
.fold(0, |accum, (a, b)| accum | a ^ b);
unsafe { core::ptr::read_volatile(&accum) == 0 } unsafe { core::ptr::read_volatile(&accum) == 0 }
} }
} }