diff --git a/src/proto/transport.rs b/src/proto/transport.rs index fe5097c..dcd73c1 100644 --- a/src/proto/transport.rs +++ b/src/proto/transport.rs @@ -2,7 +2,7 @@ use std::fmt; use std::io; use bytes::{Buf, BytesMut}; -use tokio_io::codec::length_delimited; +use tokio_io::codec::length_delimited::{Builder, Framed}; use tokio_io::{AsyncRead, AsyncWrite}; use proto::peer; @@ -37,8 +37,8 @@ fn encode_frame(frame: &T) -> io::Result { /// The returned stream and sink of frames is intended to be combined (using /// `Stream::and_then` and `Sink::with`) with the following decoding and /// encoding functions to create a stream/sink of decoded messages. -pub fn new_framed(io: T) -> length_delimited::Framed { - length_delimited::Builder::new() +pub fn new_framed(io: T) -> Framed { + Builder::new() .length_field_length(4) .little_endian() .new_framed(io)