mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 04:39:24 +00:00
fmt/clippy
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user