From bcacb713b8a6fd3e5a1ff845ee42a3caa03f8193 Mon Sep 17 00:00:00 2001 From: Nikolai Golub Date: Mon, 12 Aug 2024 16:17:28 +0200 Subject: [PATCH] Clippy fixes on rust 1.80 (#32) --- src/lib.rs | 14 +++++++------- src/namespaced_hash.rs | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 3422a45..c664df4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,15 +3,15 @@ //! This crate implements a Namespaced Merkle Tree compatible with . To quote from their documentation: //! //! > A Namespaced Merkle Tree is an ordered Merkle tree that uses a modified hash function so that each node in the tree -//! includes the range of namespaces of the messages in all of the descendants of each node. The leafs in the tree are -//! ordered by the namespace identifiers of the messages. In a namespaced Merkle tree, each non-leaf node in the tree contains -//! the lowest and highest namespace identifiers found in all the leaf nodes that are descendants of the non-leaf node, in addition -//! to the hash of the concatenation of the children of the node. This enables Merkle inclusion proofs to be created that prove to -//! a verifier that all the elements of the tree for a specific namespace have been included in a Merkle inclusion proof. -//! +//! > includes the range of namespaces of the messages in all of the descendants of each node. The leafs in the tree are +//! > ordered by the namespace identifiers of the messages. In a namespaced Merkle tree, each non-leaf node in the tree contains +//! > the lowest and highest namespace identifiers found in all the leaf nodes that are descendants of the non-leaf node, in addition +//! > to the hash of the concatenation of the children of the node. This enables Merkle inclusion proofs to be created that prove to +//! > a verifier that all the elements of the tree for a specific namespace have been included in a Merkle inclusion proof. +//! > //! > The concept was first introduced by [@musalbas](https://github.com/musalbas) in the [LazyLedger academic paper](https://arxiv.org/abs/1905.09274). //! -//! This implementation was developed independently by Sovereign Labs, and is not endorsed by the Celestia foundation. +//! This implementation was developed independently by [Sovereign Labs](https://www.sovereign.xyz/), and is not endorsed by the Celestia foundation. #[cfg(not(feature = "std"))] extern crate alloc; diff --git a/src/namespaced_hash.rs b/src/namespaced_hash.rs index 3b31d6c..5d821fc 100644 --- a/src/namespaced_hash.rs +++ b/src/namespaced_hash.rs @@ -116,8 +116,8 @@ impl MerkleHash for NamespacedSha2Hasher { let mut output = NamespacedHash::with_min_and_max_ns(min_ns, max_ns); - hasher.update(&left.iter().collect::>()); - hasher.update(&right.iter().collect::>()); + hasher.update(left.iter().collect::>()); + hasher.update(right.iter().collect::>()); output.set_hash(hasher.finalize().as_ref()); output