mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-21 22:01:34 +00:00
Fix warning in circular-buffer (#114)
This commit is contained in:
@ -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.
|
// This is not unsafe because it can only leak data, not cause uninit to be read.
|
||||||
pub fn advance(&mut self, by: usize) {
|
pub fn advance(&mut self, by: usize) {
|
||||||
assert!(by <= self.len);
|
assert!(by <= self.len);
|
||||||
|
Reference in New Issue
Block a user