diff --git a/pallas-multiplexer/src/bearers.rs b/pallas-multiplexer/src/bearers.rs index 5705076..6e93878 100644 --- a/pallas-multiplexer/src/bearers.rs +++ b/pallas-multiplexer/src/bearers.rs @@ -62,7 +62,7 @@ fn read_segment(reader: &mut impl Read) -> Result<(u16, u32, Payload), std::io:: impl Bearer for TcpStream { fn clone(&self) -> Self { - self.try_clone().unwrap() + self.try_clone().expect("error cloning tcp stream") } fn read_segment(&mut self) -> Result<(u16, u32, Payload), std::io::Error> { @@ -82,7 +82,7 @@ impl Bearer for TcpStream { #[cfg(target_family = "unix")] impl Bearer for UnixStream { fn clone(&self) -> Self { - self.try_clone().unwrap() + self.try_clone().expect("error cloning unix stream") } fn read_segment(&mut self) -> Result<(u16, u32, Payload), std::io::Error> { diff --git a/pallas-multiplexer/src/lib.rs b/pallas-multiplexer/src/lib.rs index e5b7561..9a104d6 100644 --- a/pallas-multiplexer/src/lib.rs +++ b/pallas-multiplexer/src/lib.rs @@ -161,11 +161,13 @@ impl Multiplexer { } pub fn use_channel(&mut self, protocol_id: u16) -> Channel { - self.io_handles.remove(&protocol_id).unwrap() + self.io_handles + .remove(&protocol_id) + .expect("requested channel not found in multiplexer") } pub fn join(self) { - self.tx_thread.join().unwrap(); - self.rx_thread.join().unwrap(); + self.tx_thread.join().expect("error joining tx loop thread"); + self.rx_thread.join().expect("error joining rx loop thread"); } }