fmt/clippy

This commit is contained in:
Luke Parker
2022-09-17 04:35:08 -04:00
parent fd6c58805f
commit 65c20638ce
11 changed files with 15 additions and 24 deletions

View File

@@ -165,8 +165,7 @@ impl FieldElement {
let mut bits = 0;
for (i, bit) in other.to_le_bits().iter().rev().enumerate() {
bits <<= 1;
let bit = *bit as u8;
assert_eq!(bit | 1, 1);
let bit = u8::from(*bit);
bits |= bit;
if ((i + 1) % 4) == 0 {

View File

@@ -37,9 +37,7 @@ pub mod field;
// Convert a boolean to a Choice in a *presumably* constant time manner
fn choice(value: bool) -> Choice {
let bit = value as u8;
debug_assert_eq!(bit | 1, 1);
Choice::from(bit)
Choice::from(u8::from(value))
}
macro_rules! deref_borrow {