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 <s.sterz@proxmox.com>
This commit is contained in:
Shannon Sterz 2025-03-06 13:43:31 +01:00 committed by Wolfgang Bumiller
parent b5e238613e
commit 2134657529

View File

@ -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.