INNER CODE UNIT · Rust
from
pluto/ronkathon · src/algebra/field/binary_towers/mod.rs:47
fn from(value: usize) -> Self {
match value {
0 => BinaryField::Zero,
1 => BinaryField::One,
_ => panic!("Invalid `usize` value. Must be 0 or 1."),
}
}
}
impl Add for BinaryField {
type Output = Self;
#[allow(clippy::suspicious_arithmetic_impl)]
fn add(self, rhs: Self) -> Self::Output {
if self == rhs {
Self::ZERO
} else {
Self::ONE