From 8d85681ad487fc8b5a7adb85900db9f3cf77c18a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 21 Dec 2022 09:47:27 +0100 Subject: [PATCH] re-run clippy --- satrs-example/src/main.rs | 13 ++++++++++--- satrs-example/src/pus.rs | 2 +- spacepackets | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/satrs-example/src/main.rs b/satrs-example/src/main.rs index 848246b..193804a 100644 --- a/satrs-example/src/main.rs +++ b/satrs-example/src/main.rs @@ -28,7 +28,7 @@ use spacepackets::time::TimeWriter; use spacepackets::tm::PusTm; use std::collections::HashMap; use std::net::{IpAddr, SocketAddr}; -use std::sync::mpsc::channel; +use std::sync::mpsc::{channel, TryRecvError}; use std::sync::{mpsc, Arc, RwLock}; use std::thread; use std::time::Duration; @@ -181,8 +181,15 @@ fn main() { println!("Starting AOCS thread"); let jh3 = thread::spawn(move || loop { match acs_thread_rx.try_recv() { - Ok(_) => {} - Err(_) => {} + Ok(request) => { + println!("ACS thread: Received request {:?}", request) + } + Err(e) => match e { + TryRecvError::Empty => {} + TryRecvError::Disconnected => { + println!("ACS thread: Message Queue TX disconnected!") + } + }, } thread::sleep(Duration::from_millis(500)); }); diff --git a/satrs-example/src/pus.rs b/satrs-example/src/pus.rs index 9b6c6dc..9772ccb 100644 --- a/satrs-example/src/pus.rs +++ b/satrs-example/src/pus.rs @@ -164,7 +164,7 @@ impl PusReceiver { let sender = self.request_map.get(&addressable_id.target_id).unwrap(); sender .send(Request::HkRequest(request)) - .expect(&format!("Sending HK request {:?} failed", request)) + .unwrap_or_else(|_| panic!("Sending HK request {:?} failed", request)); }; if PusPacket::subservice(pus_tc) == hk::Subservice::TcEnableGeneration as u8 { send_request(HkRequest::Enable(addressable_id.unique_id)); diff --git a/spacepackets b/spacepackets index db471e3..83e2cad 160000 --- a/spacepackets +++ b/spacepackets @@ -1 +1 @@ -Subproject commit db471e313c92c313d270d5a6f06c0414abb5fae3 +Subproject commit 83e2cad75377969b1e74379acff2c0dcf858d4cf