From e84ca292d9ebbe2aeb69dca2238bc009cc0468a2 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Fri, 25 Aug 2023 12:08:56 +1000 Subject: [PATCH] Clear incorrect implementation of clone warning Clippy emits: error: incorrect implementation of `clone` on a `Copy` type As suggested use `*self` instead of each individual field. --- hashes/src/sha256t.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hashes/src/sha256t.rs b/hashes/src/sha256t.rs index 6b94dfc8..6b4847a9 100644 --- a/hashes/src/sha256t.rs +++ b/hashes/src/sha256t.rs @@ -39,7 +39,7 @@ impl Hash { impl Copy for Hash {} impl Clone for Hash { - fn clone(&self) -> Self { Hash(self.0, self.1) } + fn clone(&self) -> Self { *self } } impl PartialEq for Hash { fn eq(&self, other: &Hash) -> bool { self.0 == other.0 }