Skip to content

Commit

Permalink
ffi: address clippy error on clone
Browse files Browse the repository at this point in the history
error: incorrect implementation of `clone` on a `Copy` type
   --> ffi/src/decoder.rs:239:29
    |
    |       fn clone(&self) -> Self {
    |  _____________________________^
    | |         SendablePtr(self.0)
    | |     }
    | |_____^ 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: `#[deny(clippy::incorrect_clone_impl_on_copy_type)]` on by default

Signed-off-by: Albert Esteve <aesteve@redhat.com>
  • Loading branch information
aesteve-rh authored and Gnurou committed Sep 19, 2023
1 parent af2099a commit eb371b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ffi/src/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ fn frame_decoded_cb(
struct SendablePtr<T>(*mut T);
impl<T> Clone for SendablePtr<T> {
fn clone(&self) -> Self {
SendablePtr(self.0)
*self
}
}
impl<T> Copy for SendablePtr<T> {}
Expand Down

0 comments on commit eb371b8

Please sign in to comment.