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