[pbs-devel] [PATCH proxmox-backup v2 4/8] datastore: fix clippy warning checking file extension

Christian Ebner c.ebner at proxmox.com
Wed Jul 30 09:57:46 CEST 2025


Follow the suggestion and check the file extension instead of relying
on the path to str conversion.

Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner at proxmox.com>
Tested-by: Lukas Wagner <l.wagner at proxmox.com>
---
changes since version 1:
 - no changes

 pbs-datastore/src/datastore.rs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs
index e3c0589a4..3b91a3583 100644
--- a/pbs-datastore/src/datastore.rs
+++ b/pbs-datastore/src/datastore.rs
@@ -1798,7 +1798,10 @@ impl DataStore {
         };
         let atime = atime.duration_since(SystemTime::UNIX_EPOCH)?.as_secs() as i64;
 
-        let bad = chunk_path.as_path().ends_with(".bad");
+        let bad = chunk_path
+            .as_path()
+            .extension()
+            .is_some_and(|ext| ext == "bad");
 
         if atime < min_atime {
             if let Some(cache) = self.cache() {
-- 
2.47.2





More information about the pbs-devel mailing list