X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-core%2Fsrc%2Fcompr%2Fmod.rs;h=a2062d497be3246ac92bb2b56b6b4c6ebab0abed;hb=2c031ed0963cfb3a37ba6c5d4b64d9bbc4250832;hp=c8069b5cc194325e75050f591d8e8671fa52f6cc;hpb=0443d0c5f73697d5eb59081be3cde9fb02dc3e70;p=nihav.git diff --git a/nihav-core/src/compr/mod.rs b/nihav-core/src/compr/mod.rs index c8069b5..a2062d4 100644 --- a/nihav-core/src/compr/mod.rs +++ b/nihav-core/src/compr/mod.rs @@ -1,5 +1,6 @@ //! Various compression formats support. #[cfg(feature="deflate")] +#[allow(clippy::manual_range_contains)] pub mod deflate; use crate::io::byteio::ByteIOError; @@ -54,8 +55,8 @@ impl From for DecompressError { } } -///! Copies requested amount of bytes from previous position in the same buffer. -///! If source area overlaps with destination area already copied values should be used e.g. copying with offset 1 means essentially to repeat previous byte requested number of times. +/// Copies requested amount of bytes from previous position in the same buffer. +/// If source area overlaps with destination area already copied values should be used e.g. copying with offset 1 means essentially to repeat previous byte requested number of times. pub fn lz_copy(buf: &mut [u8], dst_pos: usize, offset: usize, len: usize) { if dst_pos < offset { panic!("Copy offset is before buffer start."); @@ -64,7 +65,7 @@ pub fn lz_copy(buf: &mut [u8], dst_pos: usize, offset: usize, len: usize) { let buf = &mut buf[ipos..]; if ipos + len <= dst_pos { let (src, dst) = buf.split_at_mut(offset); - (&mut dst[..len]).copy_from_slice(&src[..len]); + dst[..len].copy_from_slice(&src[..len]); } else { for i in 0..len { buf[offset + i] = buf[i];