From 0a1382224ac1344997dbf38b0c2ae73841e78cad Mon Sep 17 00:00:00 2001 From: Jean-Pierre De Jesus DIAZ Date: Fri, 1 Dec 2023 11:39:06 +0100 Subject: [PATCH] xous-rs: hosted: Do not pass &mut data. data is already a &mut [_] so we were passing &mut &mut [_]. --- xous-rs/src/arch/hosted/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xous-rs/src/arch/hosted/mod.rs b/xous-rs/src/arch/hosted/mod.rs index ec20370ef..c4a0eb9b3 100644 --- a/xous-rs/src/arch/hosted/mod.rs +++ b/xous-rs/src/arch/hosted/mod.rs @@ -262,7 +262,7 @@ fn read_next_syscall_result( } else if kind == CallMemoryKind::Borrow || kind == CallMemoryKind::MutableBorrow { // Read the buffer back from the remote host. use core::slice; - let mut data = unsafe { slice::from_raw_parts_mut(mem.as_mut_ptr(), mem.len()) }; + let data = unsafe { slice::from_raw_parts_mut(mem.as_mut_ptr(), mem.len()) }; // If it's a Borrow, verify the contents haven't changed by saving the previous // buffer in a Vec called `previous_data`. @@ -272,7 +272,7 @@ fn read_next_syscall_result( }; // Read the incoming data from the network. - if let Err(e) = stream.read_exact(&mut data) { + if let Err(e) = stream.read_exact(data) { eprintln!("Server shut down: {}", e); std::process::exit(0); }