Correct clippy warnings

Currently intended to be done with:
cargo clippy --features "recommended merlin batch serialize experimental 
ed25519 ristretto p256 secp256k1 multisig" -- -A clippy::type_complexity 
-A dead_code
This commit is contained in:
Luke Parker
2022-07-22 02:34:36 -04:00
parent 3556584478
commit 76a7160ea5
36 changed files with 129 additions and 122 deletions

View File

@@ -231,7 +231,7 @@ impl PrimeField for Scalar {
fn from_repr(bytes: [u8; 32]) -> CtOption<Self> {
let scalar = DScalar::from_canonical_bytes(bytes);
// TODO: This unwrap_or isn't constant time, yet do we have an alternative?
CtOption::new(Scalar(scalar.unwrap_or(DScalar::zero())), choice(scalar.is_some()))
CtOption::new(Scalar(scalar.unwrap_or_else(DScalar::zero)), choice(scalar.is_some()))
}
fn to_repr(&self) -> [u8; 32] {
self.0.to_bytes()