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.
This commit is contained in:
Tobin C. Harding 2023-08-25 12:08:56 +10:00
parent cdbd4be4b1
commit e84ca292d9
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ impl<T: Tag> Hash<T> {
impl<T: Tag> Copy for Hash<T> {}
impl<T: Tag> Clone for Hash<T> {
fn clone(&self) -> Self { Hash(self.0, self.1) }
fn clone(&self) -> Self { *self }
}
impl<T: Tag> PartialEq for Hash<T> {
fn eq(&self, other: &Hash<T>) -> bool { self.0 == other.0 }