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:
Dominik Csapak 2021-10-28 11:47:52 +02:00 committed by Wolfgang Bumiller
parent 5c1cabdea1
commit d4e9d5470e
1 changed files with 5 additions and 5 deletions

View File

@ -11,12 +11,12 @@ use super::BackupInfo;
pub enum PruneMark { Protected, Keep, KeepPartial, Remove }
impl PruneMark {
pub fn keep(&self) -> bool {
*self != PruneMark::Remove
pub fn keep(self) -> bool {
self != PruneMark::Remove
}
pub fn protected(&self) -> bool {
*self == PruneMark::Protected
pub fn protected(self) -> bool {
self == PruneMark::Protected
}
}
@ -202,7 +202,7 @@ pub fn compute_prune_info(
let mark = if info.protected {
PruneMark::Protected
} else {
*mark.get(&backup_id).unwrap_or(&PruneMark::Remove)
mark.get(&backup_id).copied().unwrap_or(PruneMark::Remove)
};
(info, mark)