diff --git a/crates/libs/bindgen/src/metadata.rs b/crates/libs/bindgen/src/metadata.rs index 9d48c57a1d..b25e9a96b9 100644 --- a/crates/libs/bindgen/src/metadata.rs +++ b/crates/libs/bindgen/src/metadata.rs @@ -240,7 +240,7 @@ impl Signature { } // Then we see if we can infer retval-like behavior more conservatively. - self.params.last().map_or(false, |param| param.is_retval()) + self.params.last().is_some_and(|param| param.is_retval()) && self.params[..self.params.len() - 1].iter().all(|param| { let flags = param.def.flags(); !flags.contains(ParamAttributes::Out) diff --git a/crates/samples/windows/direct3d12/src/main.rs b/crates/samples/windows/direct3d12/src/main.rs index 05edb03e9c..0ff2bc2eb2 100644 --- a/crates/samples/windows/direct3d12/src/main.rs +++ b/crates/samples/windows/direct3d12/src/main.rs @@ -163,7 +163,7 @@ extern "system" fn wndproc( _ => { let user_data = unsafe { GetWindowLongPtrA(window, GWLP_USERDATA) }; let sample = std::ptr::NonNull::::new(user_data as _); - let handled = sample.map_or(false, |mut s| { + let handled = sample.is_some_and(|mut s| { sample_wndproc(unsafe { s.as_mut() }, message, wparam) });