[pbs-devel] [PATCH proxmox-backup 1/4] PruneMark: use copied values instead of references

Dominik Csapak d.csapak at proxmox.com
Thu Oct 28 11:47:52 CEST 2021


the type is small enough

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 pbs-datastore/src/prune.rs | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/pbs-datastore/src/prune.rs b/pbs-datastore/src/prune.rs
index e66ed408..c144b3db 100644
--- a/pbs-datastore/src/prune.rs
+++ b/pbs-datastore/src/prune.rs
@@ -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)
-- 
2.30.2





More information about the pbs-devel mailing list