Apply Clippy's suggestions

This commit is contained in:
Romain Ruetschi
2018-05-15 18:24:32 +02:00
parent cb390162df
commit 31e26341c9
3 changed files with 12 additions and 12 deletions

View File

@ -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,
}
}

View File

@ -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)),
})
}

View File

@ -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,
}
}