Allow clippy false positive harder
Browse files at this commit54e6a01284effb5d1addc3ad386f124afa9aade2Parent: 7721e3f1 changed file +17 -15
- src/protocols/gamma_control.rs +17 -15
src/protocols/gamma_control.rsmodified+17 -15
| @@ -178,21 +178,23 @@ where | |||
| 178 | 178 | ||
| 179 | // Verify that there's no more data. | 179 | // Verify that there's no more data. |
| 180 | #[allow(clippy::unused_io_amount)] // False positive on 1.77.0 | 180 | #[allow(clippy::unused_io_amount)] // False positive on 1.77.0 |
| 181 | - match file.read(&mut [0]) { | 181 | + { |
| 182 | - Ok(0) => (), | 182 | + match file.read(&mut [0]) { |
| 183 | - Ok(_) => { | 183 | + Ok(0) => (), |
| 184 | - warn!("gamma data is too large"); | 184 | + Ok(_) => { |
| 185 | - resource.failed(); | 185 | + warn!("gamma data is too large"); |
| 186 | - gamma_controls.remove(&output); | 186 | + resource.failed(); |
| 187 | - let _ = state.set_gamma(&output, None); | 187 | + gamma_controls.remove(&output); |
| 188 | - return; | 188 | + let _ = state.set_gamma(&output, None); |
| 189 | - } | 189 | + return; |
| 190 | - Err(err) => { | 190 | + } |
| 191 | - warn!("error reading gamma data: {err:?}"); | 191 | + Err(err) => { |
| 192 | - resource.failed(); | 192 | + warn!("error reading gamma data: {err:?}"); |
| 193 | - gamma_controls.remove(&output); | 193 | + resource.failed(); |
| 194 | - let _ = state.set_gamma(&output, None); | 194 | + gamma_controls.remove(&output); |
| 195 | - return; | 195 | + let _ = state.set_gamma(&output, None); |
| 196 | + return; | ||
| 197 | + } | ||
| 196 | } | 198 | } |
| 197 | } | 199 | } |
| 198 | } | 200 | } |