From bfb582f99b96e6e76924ae7d9b268df1bc22a629 Mon Sep 17 00:00:00 2001 From: mwojcik Date: Thu, 1 Feb 2024 14:43:26 +0800 Subject: [PATCH] cargo fmt --- src/runtime/src/comms.rs | 9 +++------ src/satman/src/subkernel.rs | 20 +++++++++++++++----- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/runtime/src/comms.rs b/src/runtime/src/comms.rs index d5960ec7..7747850e 100644 --- a/src/runtime/src/comms.rs +++ b/src/runtime/src/comms.rs @@ -451,12 +451,9 @@ async fn handle_run_kernel( .await; } #[cfg(has_drtio)] - kernel::Message::SubkernelMsgSend { - id, - destination, - data, - } => { - let res = subkernel::message_send(aux_mutex, routing_table, timer, id, destination.unwrap(), data).await; + kernel::Message::SubkernelMsgSend { id, destination, data } => { + let res = + subkernel::message_send(aux_mutex, routing_table, timer, id, destination.unwrap(), data).await; match res { Ok(_) => (), Err(e) => { diff --git a/src/satman/src/subkernel.rs b/src/satman/src/subkernel.rs index af865062..a7b56349 100644 --- a/src/satman/src/subkernel.rs +++ b/src/satman/src/subkernel.rs @@ -26,7 +26,7 @@ enum KernelState { MsgAwait { max_time: Option, id: u32, - tags: Vec + tags: Vec, }, MsgSending, SubkernelAwaitLoad, @@ -180,7 +180,13 @@ impl MessageManager { } } - pub fn handle_incoming(&mut self, status: PayloadStatus, id: u32, length: usize, data: &[u8; MASTER_PAYLOAD_MAX_SIZE]) { + pub fn handle_incoming( + &mut self, + status: PayloadStatus, + id: u32, + length: usize, + data: &[u8; MASTER_PAYLOAD_MAX_SIZE], + ) { // called when receiving a message from master if status.is_first() { self.in_buffer = None; @@ -726,7 +732,11 @@ impl<'a> Manager<'_> { } else { None }; - self.session.kernel_state = KernelState::MsgAwait { max_time: max_time, id:id, tags: tags }; + self.session.kernel_state = KernelState::MsgAwait { + max_time: max_time, + id: id, + tags: tags, + }; } kernel::Message::SubkernelLoadRunRequest { id, @@ -772,7 +782,7 @@ impl<'a> Manager<'_> { fn process_external_messages(&mut self, timer: &GlobalTimer) -> Result<(), Error> { match &self.session.kernel_state { - KernelState::MsgAwait {max_time , id, tags } => { + KernelState::MsgAwait { max_time, id, tags } => { if let Some(max_time) = *max_time { if timer.get_time() > max_time { self.control.tx.send(kernel::Message::SubkernelMsgRecvReply { @@ -819,7 +829,7 @@ impl<'a> Manager<'_> { if *status == *id { self.control.tx.send(kernel::Message::SubkernelAwaitFinishReply { status: kernel::SubkernelStatus::NoError, - }); + }); self.session.kernel_state = KernelState::Running; self.session.subkernels_finished.swap_remove(i); break;