diff --git a/implementations/rust/preserves/src/value/iolist.rs b/implementations/rust/preserves/src/value/iolist.rs index 9061d8e..2f31226 100644 --- a/implementations/rust/preserves/src/value/iolist.rs +++ b/implementations/rust/preserves/src/value/iolist.rs @@ -36,7 +36,7 @@ impl IOList { pub fn write_all(&mut self, cow: Cow<'_, [u8]>) { self.len += cow.len(); match cow { - Cow::Borrowed(bs) => self.chunks.push(bs.to_owned()), + Cow::Borrowed(bs) => self.rightmost_chunk().extend_from_slice(bs), Cow::Owned(bs) => self.chunks.push(bs), } }