From 1d928b25fe6b7f39216fb9391115281188b01ab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Wed, 20 Jan 2021 10:50:35 +0100 Subject: [PATCH] clippy: remove some unnecessary reference taking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabian Grünbichler --- src/api2/types/userid.rs | 2 +- src/backup/file_formats.rs | 10 +++++----- src/tape/inventory.rs | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/api2/types/userid.rs b/src/api2/types/userid.rs index 85c1edd1..20ce9370 100644 --- a/src/api2/types/userid.rs +++ b/src/api2/types/userid.rs @@ -277,7 +277,7 @@ impl PartialEq<&str> for RealmRef { impl PartialEq for Realm { fn eq(&self, rhs: &RealmRef) -> bool { - self.0 == &rhs.0 + self.0 == rhs.0 } } diff --git a/src/backup/file_formats.rs b/src/backup/file_formats.rs index f0caa430..a25263f2 100644 --- a/src/backup/file_formats.rs +++ b/src/backup/file_formats.rs @@ -63,11 +63,11 @@ pub struct EncryptedDataBlobHeader { /// /// Panics on unknown magic numbers. pub fn header_size(magic: &[u8; 8]) -> usize { - match magic { - &UNCOMPRESSED_BLOB_MAGIC_1_0 => std::mem::size_of::(), - &COMPRESSED_BLOB_MAGIC_1_0 => std::mem::size_of::(), - &ENCRYPTED_BLOB_MAGIC_1_0 => std::mem::size_of::(), - &ENCR_COMPR_BLOB_MAGIC_1_0 => std::mem::size_of::(), + match *magic { + UNCOMPRESSED_BLOB_MAGIC_1_0 => std::mem::size_of::(), + COMPRESSED_BLOB_MAGIC_1_0 => std::mem::size_of::(), + ENCRYPTED_BLOB_MAGIC_1_0 => std::mem::size_of::(), + ENCR_COMPR_BLOB_MAGIC_1_0 => std::mem::size_of::(), _ => panic!("unknown blob magic"), } } diff --git a/src/tape/inventory.rs b/src/tape/inventory.rs index 26d72528..8babcbf5 100644 --- a/src/tape/inventory.rs +++ b/src/tape/inventory.rs @@ -382,7 +382,7 @@ impl Inventory { let set_list = self.map.values() .filter_map(|entry| entry.id.media_set_label.as_ref()) - .filter(|set| &set.pool == &pool && set.uuid.as_ref() != [0u8;16]); + .filter(|set| set.pool == pool && set.uuid.as_ref() != [0u8;16]); for set in set_list { match last_set { @@ -405,7 +405,7 @@ impl Inventory { // consistency check - must be the only set with that ctime let set_list = self.map.values() .filter_map(|entry| entry.id.media_set_label.as_ref()) - .filter(|set| &set.pool == &pool && set.uuid.as_ref() != [0u8;16]); + .filter(|set| set.pool == pool && set.uuid.as_ref() != [0u8;16]); for set in set_list { if set.uuid != uuid && set.ctime >= ctime { // should not happen @@ -436,7 +436,7 @@ impl Inventory { let set_list = self.map.values() .filter_map(|entry| entry.id.media_set_label.as_ref()) - .filter(|set| (&set.uuid != media_set_uuid) && (&set.pool == &pool)); + .filter(|set| (&set.uuid != media_set_uuid) && (set.pool == pool)); let mut next_ctime = None;