From 1e4993136e697d69692144528bdbb4103810a6e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sosth=C3=A8ne=20Gu=C3=A9don?= Date: Thu, 27 Apr 2023 16:11:04 +0200 Subject: [PATCH] Use a reference to the interchange data instead of copying it to the stack --- src/service.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/service.rs b/src/service.rs index ecbdbf16abc..4e9ab97cb73 100644 --- a/src/service.rs +++ b/src/service.rs @@ -815,7 +815,7 @@ impl Service { let resources = &mut self.resources; for ep in eps.iter_mut() { - if let Some(request) = ep.interchange.take_request() { + if let Ok(request) = ep.interchange.request() { resources .platform .user_interface() @@ -824,12 +824,12 @@ impl Service { // resources.currently_serving = ep.client_id.clone(); let reply_result = if ep.backends.is_empty() { - resources.reply_to(&mut ep.ctx.core, &request) + resources.reply_to(&mut ep.ctx.core, request) } else { let mut reply_result = Err(Error::RequestNotAvailable); for backend in ep.backends { reply_result = - resources.dispatch(&mut self.dispatch, backend, &mut ep.ctx, &request); + resources.dispatch(&mut self.dispatch, backend, &mut ep.ctx, request); if reply_result != Err(Error::RequestNotAvailable) { break; }