From 8167f5b2fb6438a53bf3ebdd1a820c80d468435a Mon Sep 17 00:00:00 2001 From: Bauke Date: Wed, 31 Jan 2024 12:41:13 +0100 Subject: [PATCH] Remove infallible error. --- source/lib.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/source/lib.rs b/source/lib.rs index 4ab7e21..17bf190 100644 --- a/source/lib.rs +++ b/source/lib.rs @@ -57,9 +57,6 @@ use byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; /// All possible errors that can happen with reading or writing messages. #[derive(Debug, thiserror::Error)] pub enum MessagingError { - /// Infallible errors. - #[error(transparent)] - Infallible(#[from] std::convert::Infallible), #[error(transparent)] /// IO errors. Io(#[from] std::io::Error), @@ -80,7 +77,7 @@ where D: for<'a> serde::Deserialize<'a>, R: Read, { - let message_length = reader.read_u32::()?.try_into()?; + let message_length = reader.read_u32::()?.into(); let message_bytes = reader.take(message_length); serde_json::from_reader(message_bytes).map_err(Into::into)