mirror of
https://github.com/librekeys/picoforge.git
synced 2026-07-28 08:01:19 -07:00
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:
+2
-7
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user