[pbs-devel] [PATCH proxmox 01/19] io: clippy fix: replace `map()` followed by `any()` with just `any()`

Shannon Sterz s.sterz at proxmox.com
Thu Mar 6 13:43:31 CET 2025


this fixes a clippy lint that complains about map invocations followed
by any invocations that are just checking for identity as this can be
replaced by just the any invocation alone [1].

[1]:
https://rust-lang.github.io/rust-clippy/master/index.html#map_all_any_identity

Signed-off-by: Shannon Sterz <s.sterz at proxmox.com>
---
 proxmox-io/src/sparse_copy.rs | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/proxmox-io/src/sparse_copy.rs b/proxmox-io/src/sparse_copy.rs
index 9d09e6ad..fad1a51a 100644
--- a/proxmox-io/src/sparse_copy.rs
+++ b/proxmox-io/src/sparse_copy.rs
@@ -14,8 +14,7 @@ const BUF_SIZE: usize = 8192;
 /// This is implemented in a way which allows the compiler to utilize SIMD instructions.
 pub fn buffer_is_zero(buf: &[u8]) -> bool {
     !buf.chunks(128)
-        .map(|aa| aa.iter().fold(0, |a, b| a | b) != 0)
-        .any(|a| a)
+        .any(|aa| aa.iter().fold(0, |a, b| a | b) != 0)
 }
 
 /// Result of a sparse copy call.
-- 
2.39.5





More information about the pbs-devel mailing list