From 54e6a01284effb5d1addc3ad386f124afa9aade2 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Fri, 22 Mar 2024 21:24:11 +0400 Subject: Allow clippy false positive harder --- src/protocols/gamma_control.rs | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/protocols/gamma_control.rs b/src/protocols/gamma_control.rs index b123c024..4530bb41 100644 --- a/src/protocols/gamma_control.rs +++ b/src/protocols/gamma_control.rs @@ -178,21 +178,23 @@ where // Verify that there's no more data. #[allow(clippy::unused_io_amount)] // False positive on 1.77.0 - match file.read(&mut [0]) { - Ok(0) => (), - Ok(_) => { - warn!("gamma data is too large"); - resource.failed(); - gamma_controls.remove(&output); - let _ = state.set_gamma(&output, None); - return; - } - Err(err) => { - warn!("error reading gamma data: {err:?}"); - resource.failed(); - gamma_controls.remove(&output); - let _ = state.set_gamma(&output, None); - return; + { + match file.read(&mut [0]) { + Ok(0) => (), + Ok(_) => { + warn!("gamma data is too large"); + resource.failed(); + gamma_controls.remove(&output); + let _ = state.set_gamma(&output, None); + return; + } + Err(err) => { + warn!("error reading gamma data: {err:?}"); + resource.failed(); + gamma_controls.remove(&output); + let _ = state.set_gamma(&output, None); + return; + } } } } -- cgit