Skip to content

Commit 5bed8c4

Browse files
committed
correct some uses of N
1 parent f7a168d commit 5bed8c4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

zlib-rs/src/inflate/writer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ impl<'a> Writer<'a> {
163163
let len = range.end - range.start;
164164

165165
if self.remaining() >= len + N {
166-
// SAFETY: we know that our window has at least a core::mem::size_of::<N>() extra bytes
166+
// SAFETY: we know that our window has at least a N extra bytes
167167
// at the end, making it always safe to perform an (unaligned) Chunk read anywhere in
168168
// the window slice.
169169
//
@@ -339,8 +339,8 @@ impl<'a> Writer<'a> {
339339

340340
/// # Safety
341341
///
342-
/// `src` must be safe to perform unaligned reads in `core::mem::size_of::<N>()` chunks until
343-
/// `end` is reached. `dst` must be safe to (unaligned) write that number of chunks.
342+
/// `src..src + length` must be safe to perform reads in chunks of N elements until
343+
/// `src + length` is reached. `dst` must be safe to (unaligned) write that number of chunks.
344344
#[inline(always)]
345345
unsafe fn copy_chunk_unchecked<const N: usize>(
346346
mut src: *const MaybeUninit<u8>,

0 commit comments

Comments
 (0)