INNER CODE UNIT · Rust
sum
pluto/ronkathon · src/algebra/field/binary_towers/mod.rs:74
fn sum<I: Iterator<Item = Self>>(iter: I) -> Self {
iter.reduce(|x, y| x + y).unwrap_or(Self::ZERO)
}
}
impl Sub for BinaryField {
type Output = Self;
#[allow(clippy::suspicious_arithmetic_impl)]
fn sub(self, rhs: Self) -> Self::Output {
if self == rhs {
Self::ZERO
} else {
Self::ONE
}
}
}