Use reference to the response rather than copying it

This commit is contained in:
Sosthène Guédon
2023-07-12 11:39:17 +02:00
committed by sosthene-nitrokey
parent e9cbf904f5
commit 3f24df2f8b
+2 -2
View File
@@ -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);