mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-09 17:23:08 +00:00
* `Squarable` trait * Minor style * Further minor style (Squarable -> Square to match Rust convention)
12 lines
194 B
Rust
12 lines
194 B
Rust
use std::ops::Mul;
|
|
|
|
pub trait Square {
|
|
fn square(&self) -> Self;
|
|
}
|
|
|
|
impl<F: Mul<F, Output = Self> + Copy> Square for F {
|
|
default fn square(&self) -> Self {
|
|
*self * *self
|
|
}
|
|
}
|