Skip to content

Commit c272e14

Browse files
committed
fix: replace manual and_then/filter pattern with Option::filter
Fixes clippy::manual_filter lint on Rust 1.97 (CI), while keeping compatibility with 1.96 (local).
1 parent 8a769bc commit c272e14

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

src/hal/io.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,8 @@ pub fn read_device_details() -> Result<FullDeviceStatus, PFError> {
105105
}
106106
(None, Some(rescue)) => {
107107
log::info!("Using Rescue-only device details");
108-
let ft = rescue_fw_type.and_then(|ft| {
109-
if rescue.firmware_type == FirmwareType::Unknown {
110-
Some(ft)
111-
} else {
112-
None
113-
}
114-
});
108+
let ft = rescue_fw_type
109+
.filter(|_| rescue.firmware_type == FirmwareType::Unknown);
115110
Ok(FullDeviceStatus {
116111
firmware_type: ft.unwrap_or(rescue.firmware_type),
117112
..rescue

0 commit comments

Comments
 (0)