clippy fixes #240
@@ -83,7 +83,7 @@ impl SpiInterface for SpiSimInterface {
|
||||
.sim_request_tx
|
||||
.send(SimRequest::new_with_epoch_time(mgm_sensor_request))
|
||||
{
|
||||
log::error!("failed to send MGM LIS3 request: {}", e);
|
||||
log::error!("failed to send MGM LIS3 request: {e}");
|
||||
}
|
||||
match self.sim_reply_rx.recv_timeout(Duration::from_millis(50)) {
|
||||
Ok(sim_reply) => {
|
||||
@@ -97,7 +97,7 @@ impl SpiInterface for SpiSimInterface {
|
||||
.copy_from_slice(&sim_reply_lis3.raw.z.to_le_bytes());
|
||||
}
|
||||
Err(e) => {
|
||||
log::warn!("MGM LIS3 SIM reply timeout: {}", e);
|
||||
log::warn!("MGM LIS3 SIM reply timeout: {e}");
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
@@ -401,7 +401,7 @@ impl<ComInterface: SerialInterface> PcduHandler<ComInterface> {
|
||||
}
|
||||
}
|
||||
}) {
|
||||
log::warn!("receiving PCDU replies failed: {:?}", e);
|
||||
log::warn!("receiving PCDU replies failed: {e:?}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@ pub fn create_sim_client(sim_request_rx: mpsc::Receiver<SimRequest>) -> Option<S
|
||||
return Some(sim_client);
|
||||
}
|
||||
Err(e) => {
|
||||
log::warn!("sim client creation error: {}", e);
|
||||
log::warn!("sim client creation error: {e}");
|
||||
}
|
||||
}
|
||||
None
|
||||
@@ -116,7 +116,7 @@ impl SimClientUdp {
|
||||
.udp_client
|
||||
.send_to(request_json.as_bytes(), self.simulator_addr)
|
||||
{
|
||||
log::error!("error sending data to UDP SIM server: {}", e);
|
||||
log::error!("error sending data to UDP SIM server: {e}");
|
||||
break;
|
||||
} else {
|
||||
no_sim_requests_handled = false;
|
||||
@@ -151,7 +151,7 @@ impl SimClientUdp {
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
log::warn!("failed to deserialize SIM reply: {}", e);
|
||||
log::warn!("failed to deserialize SIM reply: {e}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -161,7 +161,7 @@ impl SimClientUdp {
|
||||
{
|
||||
break;
|
||||
}
|
||||
log::error!("error receiving data from UDP SIM server: {}", e);
|
||||
log::error!("error receiving data from UDP SIM server: {e}");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@ impl SpacePacketValidator for SimplePacketValidator {
|
||||
if self.valid_ids.contains(&sp_header.packet_id()) {
|
||||
return SpValidity::Valid;
|
||||
}
|
||||
log::warn!("ignoring space packet with header {:?}", sp_header);
|
||||
log::warn!("ignoring space packet with header {sp_header:?}");
|
||||
// We could perform a CRC check.. but lets keep this simple and assume that TCP ensures
|
||||
// data integrity.
|
||||
SpValidity::Skip
|
||||
|
@@ -102,7 +102,7 @@ impl PusTcDistributor {
|
||||
sender_id,
|
||||
pus_tc_result.unwrap_err()
|
||||
);
|
||||
log::warn!("raw data: {:x?}", raw_tc);
|
||||
log::warn!("raw data: {raw_tc:x?}");
|
||||
// TODO: Shouldn't this be an error?
|
||||
return Ok(HandlingStatus::HandledOne);
|
||||
}
|
||||
|
@@ -120,7 +120,7 @@ impl SimController {
|
||||
fn handle_ctrl_request(&mut self, request: &SimRequest) -> Result<(), SimRequestError> {
|
||||
let sim_ctrl_request = SimCtrlRequest::from_sim_message(request)?;
|
||||
if SIM_CTRL_REQ_WIRETAPPING {
|
||||
log::info!("received sim ctrl request: {:?}", sim_ctrl_request);
|
||||
log::info!("received sim ctrl request: {sim_ctrl_request:?}");
|
||||
}
|
||||
match sim_ctrl_request {
|
||||
SimCtrlRequest::Ping => {
|
||||
@@ -139,7 +139,7 @@ impl SimController {
|
||||
) -> Result<(), SimRequestError> {
|
||||
let mgm_request = MgmRequestLis3Mdl::from_sim_message(request)?;
|
||||
if MGM_REQ_WIRETAPPING {
|
||||
log::info!("received MGM request: {:?}", mgm_request);
|
||||
log::info!("received MGM request: {mgm_request:?}");
|
||||
}
|
||||
match mgm_request {
|
||||
MgmRequestLis3Mdl::RequestSensorData => {
|
||||
@@ -160,7 +160,7 @@ impl SimController {
|
||||
fn handle_pcdu_request(&mut self, request: &SimRequest) -> Result<(), SimRequestError> {
|
||||
let pcdu_request = PcduRequest::from_sim_message(request)?;
|
||||
if PCDU_REQ_WIRETAPPING {
|
||||
log::info!("received PCDU request: {:?}", pcdu_request);
|
||||
log::info!("received PCDU request: {pcdu_request:?}");
|
||||
}
|
||||
match pcdu_request {
|
||||
PcduRequest::RequestSwitchInfo => {
|
||||
@@ -188,7 +188,7 @@ impl SimController {
|
||||
fn handle_mgt_request(&mut self, request: &SimRequest) -> Result<(), SimRequestError> {
|
||||
let mgt_request = MgtRequest::from_sim_message(request)?;
|
||||
if MGT_REQ_WIRETAPPING {
|
||||
log::info!("received MGT request: {:?}", mgt_request);
|
||||
log::info!("received MGT request: {mgt_request:?}");
|
||||
}
|
||||
match mgt_request {
|
||||
MgtRequest::ApplyTorque { duration, dipole } => self
|
||||
|
@@ -130,7 +130,7 @@ fn main() {
|
||||
let mut udp_server =
|
||||
SimUdpServer::new(SIM_CTRL_PORT, request_sender, reply_receiver, 200, None)
|
||||
.expect("could not create UDP request server");
|
||||
log::info!("starting UDP server on port {}", SIM_CTRL_PORT);
|
||||
log::info!("starting UDP server on port {SIM_CTRL_PORT}");
|
||||
// This thread manages the simulator UDP server.
|
||||
let udp_tc_thread = thread::spawn(move || {
|
||||
udp_server.run();
|
||||
|
Reference in New Issue
Block a user