diff --git a/circular-buffer/src/lib.rs b/circular-buffer/src/lib.rs index 01b570f6..e8bb855c 100644 --- a/circular-buffer/src/lib.rs +++ b/circular-buffer/src/lib.rs @@ -459,6 +459,11 @@ impl CircularBuffer { ) } + /// 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);