From 35af55a2a76672706f38559ff0d034834fdc53f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=C3=A1n=20de=20B=C3=BArca?= Date: Thu, 3 Apr 2025 14:51:58 -0700 Subject: [PATCH] rusticl: replace `map_or(false, f)` with `is_some_and(f)` A new clippy lint fails on this pattern, causing build errors on versions >= 1.84.0. `is_some_and()` is stable from 1.70.0. Part-of: --- src/gallium/frontends/rusticl/api/memory.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/frontends/rusticl/api/memory.rs b/src/gallium/frontends/rusticl/api/memory.rs index 1229cdfe76e..38e651199fa 100644 --- a/src/gallium/frontends/rusticl/api/memory.rs +++ b/src/gallium/frontends/rusticl/api/memory.rs @@ -523,7 +523,7 @@ fn validate_image_desc( // host_ptr is not NULL and image_slice_pitch = 0, image_slice_pitch is calculated as // image_row_pitch × image_height for a 2D image array or 3D image and image_row_pitch for a 1D // image array. If image_slice_pitch is not 0, it must be a multiple of the image_row_pitch. - let has_buf_parent = parent.as_ref().map_or(false, |p| p.is_buffer()); + let has_buf_parent = parent.as_ref().is_some_and(|p| p.is_buffer()); if host_ptr.is_null() { if (desc.image_row_pitch != 0 || desc.image_slice_pitch != 0) && !has_buf_parent { return Err(err);