Skip to content

Commit

Permalink
Use infallible from instead of try_from
Browse files Browse the repository at this point in the history
This is a new lint added in 1.75.0
https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions

Signed-off-by: Gowtham Suresh Kumar <[email protected]>
  • Loading branch information
gowthamsk-arm committed Jan 11, 2024
1 parent e98236f commit ca2c0bc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/requests/common/wire_header_1_0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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!(
Expand Down

0 comments on commit ca2c0bc

Please sign in to comment.