Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Remove assert from MutableBuffer::set_len (#443)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Sep 23, 2021
1 parent 1e31977 commit 885e6c1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/buffer/mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,14 @@ impl<T: NativeType> MutableBuffer<T> {
}

/// Sets the length of this buffer.
/// # Panic
/// Panics iff `len > capacity`.
/// # Safety
/// The caller must ensure no reads are performed on any
/// item within `[len, capacity - len]`
/// # Safety:
/// The caller must uphold the following invariants:
/// * ensure no reads are performed on any
/// item within `[len, capacity - len]`
/// * ensure `len <= self.capacity()`
#[inline]
pub unsafe fn set_len(&mut self, len: usize) {
assert!(len <= self.capacity());
debug_assert!(len <= self.capacity());
self.len = len;
}

Expand Down

0 comments on commit 885e6c1

Please sign in to comment.