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`
This commit is contained in:
David Tolnay 2023-07-02 20:40:13 -07:00
parent 0dccfa4597
commit 21ee1ba697
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
1 changed files with 1 additions and 0 deletions

View File

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