From 213465752987450c7ea8f10c3758a18f0acc60b2 Mon Sep 17 00:00:00 2001 From: Shannon Sterz Date: Thu, 6 Mar 2025 13:43:31 +0100 Subject: [PATCH] io: clippy fix: replace `map()` followed by `any()` with just `any()` 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 --- 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.