fix: clippy warnings
This commit is contained in:
parent
636c92a78b
commit
09014a34d1
4 changed files with 7 additions and 30 deletions
|
@ -2,6 +2,7 @@ use crate::{ElementHasher, HashFn};
|
|||
|
||||
mod rpo;
|
||||
pub use rpo::Rpo256 as Hasher;
|
||||
pub use rpo::{INV_MDS, MDS};
|
||||
|
||||
// TYPE ALIASES
|
||||
// ================================================================================================
|
||||
|
|
|
@ -94,33 +94,6 @@ impl Deref for RpoDigest256 {
|
|||
}
|
||||
}
|
||||
|
||||
impl RpoDigest256 {
|
||||
fn iter(&self) -> RpoDigest256Iter<'_> {
|
||||
RpoDigest256Iter {
|
||||
values: &self.0,
|
||||
index: 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct RpoDigest256Iter<'a> {
|
||||
values: &'a [Felt; DIGEST_SIZE],
|
||||
index: usize,
|
||||
}
|
||||
|
||||
impl<'a> Iterator for RpoDigest256Iter<'a> {
|
||||
type Item = &'a Felt;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
if self.index >= self.values.len() {
|
||||
return None;
|
||||
}
|
||||
|
||||
self.index += 1;
|
||||
Some(&self.values[self.index - 1])
|
||||
}
|
||||
}
|
||||
|
||||
// TESTS
|
||||
// ================================================================================================
|
||||
|
||||
|
|
|
@ -378,7 +378,7 @@ impl Rpo256 {
|
|||
// MDS
|
||||
// ================================================================================================
|
||||
/// RPO MDS matrix
|
||||
const MDS: [[Felt; STATE_WIDTH]; STATE_WIDTH] = [
|
||||
pub const MDS: [[Felt; STATE_WIDTH]; STATE_WIDTH] = [
|
||||
[
|
||||
Felt::new(7),
|
||||
Felt::new(23),
|
||||
|
@ -550,7 +550,7 @@ const MDS: [[Felt; STATE_WIDTH]; STATE_WIDTH] = [
|
|||
];
|
||||
|
||||
/// RPO Inverse MDS matrix
|
||||
const INV_MDS: [[Felt; STATE_WIDTH]; STATE_WIDTH] = [
|
||||
pub const INV_MDS: [[Felt; STATE_WIDTH]; STATE_WIDTH] = [
|
||||
[
|
||||
Felt::new(14868391535953158196),
|
||||
Felt::new(13278298489594233127),
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
use crate::{Felt, Word, ZERO};
|
||||
use crate::Word;
|
||||
|
||||
#[cfg(test)]
|
||||
use crate::{Felt, ZERO};
|
||||
|
||||
pub mod merkle_path_set;
|
||||
pub mod merkle_tree;
|
||||
|
|
Loading…
Add table
Reference in a new issue