Fix warning in circular-buffer (#114)

This commit is contained in:
Pierre Krieger
2018-01-26 12:53:37 +01:00
committed by GitHub
parent 1071bfd324
commit c378bcb594

View File

@ -459,6 +459,11 @@ impl<B: Array> CircularBuffer<B> {
)
}
/// Removes the first `by` elements of the start of the buffer.
///
/// # Panic
///
/// Panics if `by` is superior to the number of elements in the buffer.
// This is not unsafe because it can only leak data, not cause uninit to be read.
pub fn advance(&mut self, by: usize) {
assert!(by <= self.len);