Fix AsyncRead::framed deprecation
authorRichard Whitehouse <github@richardwhiuk.com>
Sun, 21 Oct 2018 22:23:13 +0000 (18:23 -0400)
committerRichard Whitehouse <github@richardwhiuk.com>
Sun, 21 Oct 2018 22:23:13 +0000 (18:23 -0400)
src/codec.rs

index 266bf4fb63411694e49f76215f54d850ba18adaf..10360a5774fd14ba00d3183b5cb4e6ac6d9f8029 100644 (file)
@@ -2,7 +2,6 @@ use bytes::BytesMut;
 
 use futures::future;
 use futures::{Future, Stream};
-use tokio_io::AsyncRead;
 use tokio_core::reactor::Handle;
 use tokio_core::net::TcpListener;
 use tokio_io::codec::{Encoder, Decoder};
@@ -382,7 +381,9 @@ impl Sip {
                     let caller = caller.clone();
 
                     // Split up the read and write halves
-                    let (_sink, stream) = tcp.framed(SipCodec::new()).split();
+                    let decoder = SipCodec::new();
+
+                    let (_sink, stream) = decoder.framed(tcp).split();
 
                     let future = stream.for_each(move |message| caller(message));