cargo fmt

This commit is contained in:
occheung 2024-08-23 11:54:37 +08:00
parent 1fc3ea40f7
commit f7e2089b5b
4 changed files with 8 additions and 22 deletions

View File

@ -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)?;

View File

@ -139,7 +139,7 @@ async fn read_key(stream: &mut TcpStream) -> Result<String> {
#[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::<u8>::new();
loop {
match reply {
Packet::CoreMgmtConfigReadReply {
length,
last,
value,
} => {
Packet::CoreMgmtConfigReadReply { length, last, value } => {
buffer.extend(&value[..length as usize]);
if last {

View File

@ -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)
}
}
}

View File

@ -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,