fix: clippy warnings (#280)

This commit is contained in:
Augusto Hack
2024-02-22 05:55:02 +01:00
committed by GitHub
parent 24f72c986b
commit dbab0e9aa9
51 changed files with 197 additions and 163 deletions

View File

@@ -1,7 +1,7 @@
use crate::utils::string::ToString;
use winter_utils::{ByteReader, ByteWriter, Deserializable, DeserializationError, Serializable};
use super::{MerklePath, RpoDigest, SmtLeaf, SmtProofError, Word, SMT_DEPTH};
use crate::utils::{
string::*, ByteReader, ByteWriter, Deserializable, DeserializationError, Serializable,
};
/// A proof which can be used to assert membership (or non-membership) of key-value pairs in a
/// [`super::Smt`].
@@ -23,7 +23,8 @@ impl SmtProof {
/// # Errors
/// Returns an error if the path length is not [`SMT_DEPTH`].
pub fn new(path: MerklePath, leaf: SmtLeaf) -> Result<Self, SmtProofError> {
if path.len() != SMT_DEPTH.into() {
let depth: usize = SMT_DEPTH.into();
if path.len() != depth {
return Err(SmtProofError::InvalidPathLength(path.len()));
}