PruneMark: use copied values instead of references
the type is small enough Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
5c1cabdea1
commit
d4e9d5470e
|
@ -11,12 +11,12 @@ use super::BackupInfo;
|
||||||
pub enum PruneMark { Protected, Keep, KeepPartial, Remove }
|
pub enum PruneMark { Protected, Keep, KeepPartial, Remove }
|
||||||
|
|
||||||
impl PruneMark {
|
impl PruneMark {
|
||||||
pub fn keep(&self) -> bool {
|
pub fn keep(self) -> bool {
|
||||||
*self != PruneMark::Remove
|
self != PruneMark::Remove
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn protected(&self) -> bool {
|
pub fn protected(self) -> bool {
|
||||||
*self == PruneMark::Protected
|
self == PruneMark::Protected
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ pub fn compute_prune_info(
|
||||||
let mark = if info.protected {
|
let mark = if info.protected {
|
||||||
PruneMark::Protected
|
PruneMark::Protected
|
||||||
} else {
|
} else {
|
||||||
*mark.get(&backup_id).unwrap_or(&PruneMark::Remove)
|
mark.get(&backup_id).copied().unwrap_or(PruneMark::Remove)
|
||||||
};
|
};
|
||||||
|
|
||||||
(info, mark)
|
(info, mark)
|
||||||
|
|
Loading…
Reference in New Issue