From 56c2d3631c3125b02479dc0d3b2b488fb3363b65 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 12 Apr 2019 19:18:32 -0700 Subject: [PATCH] clippy: Resolve option_map_unit_fn TEST=bin/clippy Change-Id: I814cfce68c147f63d96fce6d0c465488ad3e336a Reviewed-on: https://chromium-review.googlesource.com/1566744 Commit-Ready: David Tolnay Tested-by: David Tolnay Tested-by: kokoro Reviewed-by: Daniel Verkamp --- bin/clippy | 1 - devices/src/virtio/wl.rs | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) 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)