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).
This commit is contained in:
Suyog Tandel
2026-07-09 20:29:12 +05:30
parent 8a769bc169
commit c272e148da
+2 -7
View File
@@ -105,13 +105,8 @@ pub fn read_device_details() -> Result<FullDeviceStatus, PFError> {
}
(None, Some(rescue)) => {
log::info!("Using Rescue-only device details");
let ft = rescue_fw_type.and_then(|ft| {
if rescue.firmware_type == FirmwareType::Unknown {
Some(ft)
} else {
None
}
});
let ft = rescue_fw_type
.filter(|_| rescue.firmware_type == FirmwareType::Unknown);
Ok(FullDeviceStatus {
firmware_type: ft.unwrap_or(rescue.firmware_type),
..rescue