From 45bed0445d146fe83465e4d0085ac32d7301fd91 Mon Sep 17 00:00:00 2001 From: Ivan Smirnov Date: Mon, 3 Jan 2022 14:30:37 +0300 Subject: [PATCH] Fix a few clippy warnings --- src/decode.rs | 2 +- src/encode.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/decode.rs b/src/decode.rs index 8a53f4e..962cd8b 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -81,7 +81,7 @@ where if unlikely(data.len() < QOI_PADDING_SIZE) { return Err(Error::UnexpectedBufferEnd); - } else if unlikely(&data[..QOI_PADDING_SIZE] != &QOI_PADDING) { + } else if unlikely(data[..QOI_PADDING_SIZE] != QOI_PADDING) { return Err(Error::InvalidPadding); } diff --git a/src/encode.rs b/src/encode.rs index 5b7bbf3..935c6e3 100644 --- a/src/encode.rs +++ b/src/encode.rs @@ -88,6 +88,7 @@ pub struct QoiEncoder<'a> { impl<'a> QoiEncoder<'a> { #[inline] + #[allow(clippy::cast_possible_truncation)] pub fn new(data: &'a (impl AsRef<[u8]> + ?Sized), width: u32, height: u32) -> Result { let data = data.as_ref(); let mut header =