diff --git a/bin/clippy b/bin/clippy index f2a2a01369..cd0ead9011 100755 --- a/bin/clippy +++ b/bin/clippy @@ -14,7 +14,6 @@ cd .. SUPPRESS=( # To be resolved. let_unit_value - option_map_unit_fn question_mark range_plus_one redundant_closure diff --git a/devices/src/virtio/wl.rs b/devices/src/virtio/wl.rs index 2352998992..08890b0b19 100644 --- a/devices/src/virtio/wl.rs +++ b/devices/src/virtio/wl.rs @@ -1308,9 +1308,9 @@ impl WlState { // hangup events. for &send_vfd_id in &send_vfd_ids[..vfd_count] { if send_vfd_id.kind == VIRTIO_WL_CTRL_VFD_SEND_KIND_LOCAL { - self.vfds - .get_mut(&send_vfd_id.id.into()) - .map(|vfd| vfd.close_remote()); + if let Some(vfd) = self.vfds.get_mut(&send_vfd_id.id.into()) { + vfd.close_remote(); + } } } Ok(WlResp::Ok)