From 3f24df2f8b799eb203539c0e723854e8f7739f79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sosth=C3=A8ne=20Gu=C3=A9don?= Date: Tue, 11 Jul 2023 17:21:04 +0200 Subject: [PATCH] Use reference to the response rather than copying it --- src/pipe.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pipe.rs b/src/pipe.rs index 8db86f7..f81dfa1 100644 --- a/src/pipe.rs +++ b/src/pipe.rs @@ -573,8 +573,8 @@ impl<'alloc, 'pipe, 'interrupt, Bus: UsbBus> Pipe<'alloc, 'pipe, 'interrupt, Bus #[inline(never)] pub fn handle_response(&mut self) { if let State::WaitingOnAuthenticator(request) = self.state { - if let Some(response) = self.interchange.take_response() { - match response.0 { + if let Ok(response) = self.interchange.response() { + match &response.0 { Err(ctaphid_dispatch::app::Error::InvalidCommand) => { info!("Got waiting reply from authenticator??"); self.start_sending_error(request, AuthenticatorError::InvalidCommand);