From 0d3f9e74c519991102209baa177e64259387fd58 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Thu, 19 Dec 2019 09:50:31 +0600 Subject: [PATCH] Use .advance() intead of .split_to() --- actix-codec/CHANGES.md | 2 ++ actix-codec/src/framed.rs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/actix-codec/CHANGES.md b/actix-codec/CHANGES.md index 1101b6de..2259e44e 100644 --- a/actix-codec/CHANGES.md +++ b/actix-codec/CHANGES.md @@ -1,5 +1,7 @@ # Changes +* Use `.advance()` intead of `.split_to()` + ## [0.2.0] - 2019-12-10 * Use specific futures dependencies diff --git a/actix-codec/src/framed.rs b/actix-codec/src/framed.rs index e5d45804..146d2258 100644 --- a/actix-codec/src/framed.rs +++ b/actix-codec/src/framed.rs @@ -2,7 +2,7 @@ use std::pin::Pin; use std::task::{Context, Poll}; use std::{fmt, io}; -use bytes::BytesMut; +use bytes::{Buf, BytesMut}; use futures_core::{ready, Stream}; use futures_sink::Sink; @@ -288,7 +288,7 @@ impl Framed { } // remove written data - let _ = self.write_buf.split_to(n); + self.write_buf.advance(n); } // Try flushing the underlying IO