From c7959216316240e23c00ab71c2403d7f1a0b720a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sch=C3=A4fer?= Date: Sun, 1 Sep 2024 10:56:07 +0200 Subject: [PATCH] xmlstream: fix crash This happened when (a bit too hastily) applying suggestions from a review. --- tokio-xmpp/src/xmlstream/capture.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/tokio-xmpp/src/xmlstream/capture.rs b/tokio-xmpp/src/xmlstream/capture.rs index 4043877ab3b80536710e955a91cddafdbd943725..5b809bf20037735598d602cabc483acd236eb592 100644 --- a/tokio-xmpp/src/xmlstream/capture.rs +++ b/tokio-xmpp/src/xmlstream/capture.rs @@ -88,7 +88,6 @@ impl CaptureBufRead { 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) }