From 021e942e47dd2db7e9a9079dbe176dbebccf53d7 Mon Sep 17 00:00:00 2001 From: Jan Niehusmann Date: Sat, 26 Feb 2022 16:27:24 +0000 Subject: [PATCH] Fix clippy warnings --- rp2040-hal/src/usb.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rp2040-hal/src/usb.rs b/rp2040-hal/src/usb.rs index 810825c..6a2efd1 100644 --- a/rp2040-hal/src/usb.rs +++ b/rp2040-hal/src/usb.rs @@ -259,8 +259,7 @@ impl Inner { let ep = self .in_endpoints .get_mut(index) - .map(Option::as_mut) - .flatten() + .and_then(Option::as_mut) .ok_or(UsbError::InvalidEndpoint)?; let buf_control = &self.ctrl_dpram.ep_buffer_control[index * 2]; @@ -289,8 +288,7 @@ impl Inner { let ep = self .out_endpoints .get_mut(index) - .map(Option::as_mut) - .flatten() + .and_then(Option::as_mut) .ok_or(UsbError::InvalidEndpoint)?; let buf_control = &self.ctrl_dpram.ep_buffer_control[index * 2 + 1];