Skip to content

Commit

Permalink
data: fix unnecessary as_ref in TryFrom for ByteStr
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed May 14, 2023
1 parent a996c88 commit dd74107
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/data/byte_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl TryFrom<&[u8]> for ByteStr {
type Error = OverflowError;

fn try_from(slice: &[u8]) -> Result<Self, Self::Error> {
let len = slice.as_ref().len();
let len = slice.len();
if len > u16::MAX as usize {
return Err(OverflowError { max: u16::MAX as usize + 1, value: len });
}
Expand Down

0 comments on commit dd74107

Please sign in to comment.