From c378bcb59470cfc8f0f32afa4251aa8cc526f114 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Fri, 26 Jan 2018 12:53:37 +0100 Subject: [PATCH] Fix warning in circular-buffer (#114) --- circular-buffer/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) 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);