From 21ee1ba69749a20a076c15a310612c5b4350d844 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 2 Jul 2023 20:40:13 -0700 Subject: [PATCH] Suppress incorrect_clone_impl_on_copy_type clippy false positive https://github.com/rust-lang/rust-clippy/issues/11072 error: incorrect implementation of `clone` on a `Copy` type --> src/lib.rs:74:29 | 74 | fn clone(&self) -> Self { | _____________________________^ 75 | | Buffer::new() 76 | | } | |_____^ help: change this to: `{ *self }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incorrect_clone_impl_on_copy_type = note: `-D clippy::incorrect-clone-impl-on-copy-type` implied by `-D clippy::all` --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.rs b/src/lib.rs index e560aaa..f7b9e8f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -72,6 +72,7 @@ impl Copy for Buffer {} impl Clone for Buffer { #[inline] + #[allow(clippy::incorrect_clone_impl_on_copy_type)] // false positive https://github.com/rust-lang/rust-clippy/issues/11072 fn clone(&self) -> Self { Buffer::new() }