From f7e2089b5b364243b6c1f275a096ff3a3c4cb30c Mon Sep 17 00:00:00 2001 From: occheung Date: Fri, 23 Aug 2024 11:54:37 +0800 Subject: [PATCH] cargo fmt --- src/libboard_artiq/src/drtioaux_proto.rs | 10 +++------- src/runtime/src/mgmt.rs | 8 ++------ src/satman/src/main.rs | 10 ++-------- src/satman/src/routing.rs | 2 +- 4 files changed, 8 insertions(+), 22 deletions(-) diff --git a/src/libboard_artiq/src/drtioaux_proto.rs b/src/libboard_artiq/src/drtioaux_proto.rs index a1ca7b7..13407d9 100644 --- a/src/libboard_artiq/src/drtioaux_proto.rs +++ b/src/libboard_artiq/src/drtioaux_proto.rs @@ -691,7 +691,7 @@ impl Packet { length: length, data: data, } - }, + } 0xdc => { let last = reader.read_bool()?; let length = reader.read_u16()?; @@ -702,7 +702,7 @@ impl Packet { length: length, value: value, } - }, + } 0xdd => Packet::CoreMgmtAck, 0xde => Packet::CoreMgmtNack, @@ -1155,11 +1155,7 @@ impl Packet { writer.write_u16(length)?; writer.write_all(&data[0..length as usize])?; } - Packet::CoreMgmtConfigReadReply { - last, - length, - value, - } => { + Packet::CoreMgmtConfigReadReply { last, length, value } => { writer.write_u8(0xdc)?; writer.write_bool(last)?; writer.write_u16(length)?; diff --git a/src/runtime/src/mgmt.rs b/src/runtime/src/mgmt.rs index bb210cf..5e35fdd 100644 --- a/src/runtime/src/mgmt.rs +++ b/src/runtime/src/mgmt.rs @@ -139,7 +139,7 @@ async fn read_key(stream: &mut TcpStream) -> Result { #[cfg(has_drtio)] mod remote_coremgmt { use io::{Cursor, ProtoWrite}; - use libboard_artiq::drtioaux_proto::{MASTER_PAYLOAD_MAX_SIZE, Packet}; + use libboard_artiq::drtioaux_proto::{Packet, MASTER_PAYLOAD_MAX_SIZE}; use super::*; use crate::rtio_mgt::drtio; @@ -351,11 +351,7 @@ mod remote_coremgmt { let mut buffer = Vec::::new(); loop { match reply { - Packet::CoreMgmtConfigReadReply { - length, - last, - value, - } => { + Packet::CoreMgmtConfigReadReply { length, last, value } => { buffer.extend(&value[..length as usize]); if last { diff --git a/src/satman/src/main.rs b/src/satman/src/main.rs index 2cd01da..cd4b485 100644 --- a/src/satman/src/main.rs +++ b/src/satman/src/main.rs @@ -1132,10 +1132,7 @@ fn process_aux_packet( let key_slice = &key[..length as usize]; if !key_slice.is_ascii() { error!("invalid key"); - drtioaux::send( - 0, - &drtioaux::Packet::CoreMgmtNack, - ) + drtioaux::send(0, &drtioaux::Packet::CoreMgmtNack) } else { let key = core::str::from_utf8(key_slice).unwrap(); if core_manager.fetch_config_value(key).is_ok() { @@ -1149,10 +1146,7 @@ fn process_aux_packet( }, ) } else { - drtioaux::send( - 0, - &drtioaux::Packet::CoreMgmtNack, - ) + drtioaux::send(0, &drtioaux::Packet::CoreMgmtNack) } } } diff --git a/src/satman/src/routing.rs b/src/satman/src/routing.rs index 9f1676a..2ea1ac5 100644 --- a/src/satman/src/routing.rs +++ b/src/satman/src/routing.rs @@ -4,7 +4,7 @@ use core::cmp::min; #[cfg(has_drtio_routing)] use libboard_artiq::pl::csr; use libboard_artiq::{drtio_routing, drtioaux, - drtioaux_proto::{PayloadStatus, SAT_PAYLOAD_MAX_SIZE, MASTER_PAYLOAD_MAX_SIZE}}; + drtioaux_proto::{PayloadStatus, MASTER_PAYLOAD_MAX_SIZE, SAT_PAYLOAD_MAX_SIZE}}; pub struct SliceMeta { pub destination: u8,