From 83ac12d5e11c6b87f2ef6e345d43e1398fd96e59 Mon Sep 17 00:00:00 2001 From: Alexander Weiss Date: Thu, 22 Sep 2022 16:10:27 +0200 Subject: [PATCH] Adapt to new rustc version --- src/commands/forget.rs | 2 +- src/commands/prune.rs | 2 +- src/commands/restore.rs | 2 +- src/commands/tag.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/commands/forget.rs b/src/commands/forget.rs index 694a9be..5df976b 100644 --- a/src/commands/forget.rs +++ b/src/commands/forget.rs @@ -368,6 +368,6 @@ impl KeepOptions { } } - keep.then(|| reason) + keep.then_some(reason) } } diff --git a/src/commands/prune.rs b/src/commands/prune.rs index b818b56..16fc386 100644 --- a/src/commands/prune.rs +++ b/src/commands/prune.rs @@ -617,7 +617,7 @@ impl Pruner { let max_repack = match max_repack { LimitOption::Unlimited => u64::MAX, LimitOption::Size(size) => size.as_u64(), - LimitOption::Percentage(p) => (p * self.stats.total_size().total()), + LimitOption::Percentage(p) => p * self.stats.total_size().total(), }; self.repack_candidates.sort_unstable_by_key(|rc| rc.0); diff --git a/src/commands/restore.rs b/src/commands/restore.rs index ed3764c..c9bc09a 100644 --- a/src/commands/restore.rs +++ b/src/commands/restore.rs @@ -472,7 +472,7 @@ impl FileInfos { } // Tell to allocate the size only if the file does NOT exist with matching size - Ok(open_file.is_none().then(|| file_pos)) + Ok(open_file.is_none().then_some(file_pos)) } fn to_packs(&self) -> Vec { diff --git a/src/commands/tag.rs b/src/commands/tag.rs index e1115c7..7758905 100644 --- a/src/commands/tag.rs +++ b/src/commands/tag.rs @@ -139,5 +139,5 @@ fn modify_sn( } } - changed.then(|| sn) + changed.then_some(sn) }