diff --git a/Cargo.toml b/Cargo.toml index 171b6d2..848526d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bytedata" -version = "0.1.11" +version = "0.1.12" edition = "2021" rust-version = "1.75" description = "Representation of a byte slice that is either static, borrowed, or shared." diff --git a/src/queue/byte_queue.rs b/src/queue/byte_queue.rs index 72f724b..b05cb16 100644 --- a/src/queue/byte_queue.rs +++ b/src/queue/byte_queue.rs @@ -440,7 +440,7 @@ impl<'a> ByteQueue<'a> { pub fn split_off(&mut self, at: usize) -> Self { fn inner<'a>(this: &mut ByteQueue<'a>, at: usize) -> ByteQueue<'a> { let mut out = ByteQueue::new(); - let mut remain = at; + let mut remain = this.len() - at; while let Some(av) = this.pop_back() { let len = av.len(); if len > remain {