From 8424d19ea9d287af7665403b48d24d7b6a1ae589 Mon Sep 17 00:00:00 2001 From: bunnie Date: Mon, 23 Sep 2024 00:00:41 +0800 Subject: [PATCH] fixup API to not rely on copy, instead use borrow also some more regex fixup --- services/net/src/connection_manager.rs | 28 ++++++++++++++------------ services/net/src/main.rs | 6 +++--- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/services/net/src/connection_manager.rs b/services/net/src/connection_manager.rs index 1d974f94d..1dc5814e1 100644 --- a/services/net/src/connection_manager.rs +++ b/services/net/src/connection_manager.rs @@ -252,7 +252,7 @@ pub(crate) fn connection_manager(sid: xous::SID, activity_interval: Arc log::warn!("Couldn't update wifi state subscriber: {:?}", e), _ => (), @@ -561,7 +562,7 @@ pub(crate) fn connection_manager(sid: xous::SID, activity_interval: Arc log::warn!("Couldn't update wifi state subscriber: {:?}", e), _ => (), @@ -720,7 +722,7 @@ pub(crate) fn connection_manager(sid: xous::SID, activity_interval: Arc ! { let remote = IpAddress::from(pkt.endpoint); // we take advantage of the fact that the same CID is always returned for repeated connect // requests to the same SID. - let cid = match pkt.server { - XousServerId::PrivateSid(sid) => match xous::connect(SID::from_array(sid)) { + let cid = match &pkt.server { + XousServerId::PrivateSid(sid) => match xous::connect(SID::from_array(*sid)) { Ok(cid) => cid, Err(e) => { log::error!( @@ -455,7 +455,7 @@ fn main() -> ! { continue; } }, - XousServerId::ServerName(name) => match xns.request_connection(name.to_str()) { + XousServerId::ServerName(name) => match xns.request_connection(&name) { Ok(cid) => cid, Err(e) => { log::error!(