From 873dd86b4dd75dc0cbaeb3262dd039f8b4d9647c Mon Sep 17 00:00:00 2001 From: Simon Renblad Date: Thu, 19 Sep 2024 10:23:31 +0800 Subject: [PATCH] runtime: cargo fmt (NFC) --- src/runtime/src/comms.rs | 10 +++++----- src/runtime/src/mgmt.rs | 7 ++++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/runtime/src/comms.rs b/src/runtime/src/comms.rs index c9483ec..6519296 100644 --- a/src/runtime/src/comms.rs +++ b/src/runtime/src/comms.rs @@ -781,7 +781,7 @@ pub fn main(timer: GlobalTimer, cfg: Config) { error!("Error loading startup kernel!"); } } - + let cfg = Rc::new(cfg); let restart_idle = Rc::new(Semaphore::new(1, 1)); mgmt::start(cfg.clone(), restart_idle.clone()); @@ -797,9 +797,9 @@ pub fn main(timer: GlobalTimer, cfg: Config) { s = (async { TcpStream::accept(1381, 0x10_000, 0x10_000).await.unwrap() }).fuse() => Some(s), - _ = (async { - restart_idle.async_wait().await; - can_restart_idle.async_wait().await; + _ = (async { + restart_idle.async_wait().await; + can_restart_idle.async_wait().await; }).fuse() => None }; @@ -908,7 +908,7 @@ pub fn soft_panic_main(timer: GlobalTimer, cfg: Config) -> ! { }; Sockets::init(32); - + let dummy = Rc::new(Semaphore::new(0, 1)); mgmt::start(Rc::new(cfg), dummy); diff --git a/src/runtime/src/mgmt.rs b/src/runtime/src/mgmt.rs index e802316..1a5590f 100644 --- a/src/runtime/src/mgmt.rs +++ b/src/runtime/src/mgmt.rs @@ -112,7 +112,12 @@ async fn read_key(stream: &mut TcpStream) -> Result { Ok(String::from_utf8(buffer).unwrap()) } -async fn handle_connection(stream: &mut TcpStream, pull_id: Rc>, cfg: Rc, restart_idle: Rc) -> Result<()> { +async fn handle_connection( + stream: &mut TcpStream, + pull_id: Rc>, + cfg: Rc, + restart_idle: Rc, +) -> Result<()> { if !expect(&stream, b"ARTIQ management\n").await? { return Err(Error::UnexpectedPattern); }