diff --git a/src/requests/common/wire_header_1_0.rs b/src/requests/common/wire_header_1_0.rs index 9469cb6..86d28bd 100644 --- a/src/requests/common/wire_header_1_0.rs +++ b/src/requests/common/wire_header_1_0.rs @@ -10,7 +10,6 @@ use arbitrary::Arbitrary; use bincode::Options; use log::error; use serde::{Deserialize, Serialize}; -use std::convert::TryFrom; use std::io::{Read, Write}; const WIRE_PROTOCOL_VERSION_MAJ: u8 = 1; @@ -120,7 +119,7 @@ impl WireHeader { } let hdr_size = get_from_stream!(stream, u16); - let mut bytes = vec![0_u8; usize::try_from(hdr_size)?]; + let mut bytes = vec![0_u8; usize::from(hdr_size)]; stream.read_exact(&mut bytes)?; if hdr_size != REQUEST_HDR_SIZE { error!( diff --git a/src/requests/request/mod.rs b/src/requests/request/mod.rs index 6fe5bd3..cdfe72c 100644 --- a/src/requests/request/mod.rs +++ b/src/requests/request/mod.rs @@ -94,7 +94,7 @@ impl Request { return Err(ResponseStatus::BodySizeExceedsLimit); } let body = RequestBody::read_from_stream(stream, body_len)?; - let auth = RequestAuth::read_from_stream(stream, usize::try_from(raw_header.auth_len)?)?; + let auth = RequestAuth::read_from_stream(stream, usize::from(raw_header.auth_len))?; Ok(Request { header: raw_header.try_into()?,