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

Removed assert from MutableBuffer::set_len #443

Merged
merged 1 commit into from
Sep 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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