[pbs-devel] applied-series: [PATCH proxmox-backup 1/4] PruneMark: use copied values instead of references
Wolfgang Bumiller
w.bumiller at proxmox.com
Thu Oct 28 12:57:08 CEST 2021
applied series
On Thu, Oct 28, 2021 at 11:47:52AM +0200, Dominik Csapak wrote:
> 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