clippy: remove some unnecessary reference taking
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
f2f81791d1
commit
1d928b25fe
|
@ -277,7 +277,7 @@ impl PartialEq<&str> for RealmRef {
|
||||||
|
|
||||||
impl PartialEq<RealmRef> for Realm {
|
impl PartialEq<RealmRef> for Realm {
|
||||||
fn eq(&self, rhs: &RealmRef) -> bool {
|
fn eq(&self, rhs: &RealmRef) -> bool {
|
||||||
self.0 == &rhs.0
|
self.0 == rhs.0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,11 +63,11 @@ pub struct EncryptedDataBlobHeader {
|
||||||
///
|
///
|
||||||
/// Panics on unknown magic numbers.
|
/// Panics on unknown magic numbers.
|
||||||
pub fn header_size(magic: &[u8; 8]) -> usize {
|
pub fn header_size(magic: &[u8; 8]) -> usize {
|
||||||
match magic {
|
match *magic {
|
||||||
&UNCOMPRESSED_BLOB_MAGIC_1_0 => std::mem::size_of::<DataBlobHeader>(),
|
UNCOMPRESSED_BLOB_MAGIC_1_0 => std::mem::size_of::<DataBlobHeader>(),
|
||||||
&COMPRESSED_BLOB_MAGIC_1_0 => std::mem::size_of::<DataBlobHeader>(),
|
COMPRESSED_BLOB_MAGIC_1_0 => std::mem::size_of::<DataBlobHeader>(),
|
||||||
&ENCRYPTED_BLOB_MAGIC_1_0 => std::mem::size_of::<EncryptedDataBlobHeader>(),
|
ENCRYPTED_BLOB_MAGIC_1_0 => std::mem::size_of::<EncryptedDataBlobHeader>(),
|
||||||
&ENCR_COMPR_BLOB_MAGIC_1_0 => std::mem::size_of::<EncryptedDataBlobHeader>(),
|
ENCR_COMPR_BLOB_MAGIC_1_0 => std::mem::size_of::<EncryptedDataBlobHeader>(),
|
||||||
_ => panic!("unknown blob magic"),
|
_ => panic!("unknown blob magic"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -382,7 +382,7 @@ impl Inventory {
|
||||||
|
|
||||||
let set_list = self.map.values()
|
let set_list = self.map.values()
|
||||||
.filter_map(|entry| entry.id.media_set_label.as_ref())
|
.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 {
|
for set in set_list {
|
||||||
match last_set {
|
match last_set {
|
||||||
|
@ -405,7 +405,7 @@ impl Inventory {
|
||||||
// consistency check - must be the only set with that ctime
|
// consistency check - must be the only set with that ctime
|
||||||
let set_list = self.map.values()
|
let set_list = self.map.values()
|
||||||
.filter_map(|entry| entry.id.media_set_label.as_ref())
|
.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 {
|
for set in set_list {
|
||||||
if set.uuid != uuid && set.ctime >= ctime { // should not happen
|
if set.uuid != uuid && set.ctime >= ctime { // should not happen
|
||||||
|
@ -436,7 +436,7 @@ impl Inventory {
|
||||||
|
|
||||||
let set_list = self.map.values()
|
let set_list = self.map.values()
|
||||||
.filter_map(|entry| entry.id.media_set_label.as_ref())
|
.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;
|
let mut next_ctime = None;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue