xmlstream: fix crash

This happened when (a bit too hastily) applying suggestions from a
review.
This commit is contained in:
Jonas Schäfer 2024-09-01 10:56:07 +02:00 committed by Link Mauve
commit c795921631

View file

@ -88,7 +88,6 @@ impl<T> CaptureBufRead<T> {
let this = self.project();
let (buf, consumed_up_to) = this.buf.as_mut()?;
let result = buf.drain(..*consumed_up_to).collect();
buf.drain(..*consumed_up_to);
*consumed_up_to = 0;
Some(result)
}