From a92dcccf4867d0d464d11154bf584d28fec96e39 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Thu, 14 Mar 2024 18:49:51 -0400 Subject: [PATCH] Enable `clippy::non_canonical_clone_impl` (#9373) This PR enables the [`clippy::non_canonical_clone_impl`](https://rust-lang.github.io/rust-clippy/master/index.html#/non_canonical_clone_impl) rule and fixes the outstanding violations. Release Notes: - N/A --- Cargo.toml | 1 - crates/rpc/src/peer.rs | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f6dc769635..041c3214a1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -415,7 +415,6 @@ arc_with_non_send_sync = "allow" borrowed_box = "allow" let_underscore_future = "allow" map_entry = "allow" -non_canonical_clone_impl = "allow" non_canonical_partial_ord_impl = "allow" reversed_empty_ranges = "allow" type_complexity = "allow" diff --git a/crates/rpc/src/peer.rs b/crates/rpc/src/peer.rs index 486e758a3c..cd1cdaffcc 100644 --- a/crates/rpc/src/peer.rs +++ b/crates/rpc/src/peer.rs @@ -63,11 +63,7 @@ pub struct Receipt { impl Clone for Receipt { fn clone(&self) -> Self { - Self { - sender_id: self.sender_id, - message_id: self.message_id, - payload_type: PhantomData, - } + *self } }