mirror of
https://github.com/mii443/merkle.rs.git
synced 2025-08-22 16:05:30 +00:00
Apply Clippy's suggestions
This commit is contained in:
@ -71,7 +71,7 @@ impl<T> MerkleTree<T> {
|
||||
{
|
||||
if values.is_empty() {
|
||||
return MerkleTree {
|
||||
algorithm: algorithm,
|
||||
algorithm,
|
||||
root: Tree::empty(algorithm.hash_empty()),
|
||||
height: 0,
|
||||
count: 0,
|
||||
@ -118,10 +118,10 @@ impl<T> MerkleTree<T> {
|
||||
let root = cur.remove(0);
|
||||
|
||||
MerkleTree {
|
||||
algorithm: algorithm,
|
||||
root: root,
|
||||
height: height,
|
||||
count: count,
|
||||
algorithm,
|
||||
root,
|
||||
height,
|
||||
count,
|
||||
}
|
||||
}
|
||||
|
||||
|
12
src/proof.rs
12
src/proof.rs
@ -84,12 +84,12 @@ impl<T: Hash> Hash for Proof<T> {
|
||||
|
||||
impl<T> Proof<T> {
|
||||
/// Constructs a new `Proof`
|
||||
pub fn new(algo: &'static Algorithm, root_hash: Vec<u8>, lemma: Lemma, value: T) -> Self {
|
||||
pub fn new(algorithm: &'static Algorithm, root_hash: Vec<u8>, lemma: Lemma, value: T) -> Self {
|
||||
Proof {
|
||||
algorithm: algo,
|
||||
root_hash: root_hash,
|
||||
lemma: lemma,
|
||||
value: value,
|
||||
algorithm,
|
||||
root_hash,
|
||||
lemma,
|
||||
value,
|
||||
}
|
||||
}
|
||||
|
||||
@ -187,7 +187,7 @@ impl Lemma {
|
||||
})
|
||||
.map(|(sub_lemma, sibling_hash)| Lemma {
|
||||
node_hash: hash.into(),
|
||||
sibling_hash: sibling_hash,
|
||||
sibling_hash,
|
||||
sub_lemma: Some(Box::new(sub_lemma)),
|
||||
})
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ impl<T> Tree<T> {
|
||||
pub fn new(hash: Digest, value: T) -> Self {
|
||||
Tree::Leaf {
|
||||
hash: hash.as_ref().into(),
|
||||
value: value,
|
||||
value,
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user