From fe4b71d76c97838ad857329ef4d1ac5cc0a468ae Mon Sep 17 00:00:00 2001 From: Sasha Hilton Date: Wed, 20 Mar 2019 16:46:44 +0100 Subject: [PATCH] Fix tokio depreciation warnings --- Cargo.lock | 1 + core/Cargo.toml | 1 + core/src/connection/handshake.rs | 4 ++-- core/src/connection/mod.rs | 2 +- core/src/lib.rs | 1 + 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1f072f22..4c66953c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -541,6 +541,7 @@ dependencies = [ "serde_derive 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)", "shannon 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/core/Cargo.toml b/core/Cargo.toml index e441388a..1f2d07dc 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -30,6 +30,7 @@ serde = "0.9.6" serde_derive = "0.9.6" serde_json = "0.9.5" shannon = "0.2.0" +tokio-codec = "0.1.1" tokio-core = "0.1.2" tokio-io = "0.1" url = "1.7.0" diff --git a/core/src/connection/handshake.rs b/core/src/connection/handshake.rs index e5c834d4..42839668 100644 --- a/core/src/connection/handshake.rs +++ b/core/src/connection/handshake.rs @@ -7,7 +7,7 @@ use protobuf::{self, Message}; use rand::thread_rng; use std::io::{self, Read}; use std::marker::PhantomData; -use tokio_io::codec::Framed; +use tokio_codec::{Decoder, Framed}; use tokio_io::io::{read_exact, write_all, ReadExact, Window, WriteAll}; use tokio_io::{AsyncRead, AsyncWrite}; @@ -73,7 +73,7 @@ impl Future for Handshake { ClientResponse(ref mut codec, ref mut write) => { let (connection, _) = try_ready!(write.poll()); let codec = codec.take().unwrap(); - let framed = connection.framed(codec); + let framed = codec.framed(connection); return Ok(Async::Ready(framed)); } } diff --git a/core/src/connection/mod.rs b/core/src/connection/mod.rs index 7e527b20..91b46c80 100644 --- a/core/src/connection/mod.rs +++ b/core/src/connection/mod.rs @@ -10,7 +10,7 @@ use std::io; use std::net::ToSocketAddrs; use tokio_core::net::TcpStream; use tokio_core::reactor::Handle; -use tokio_io::codec::Framed; +use tokio_codec::Framed; use url::Url; use authentication::Credentials; diff --git a/core/src/lib.rs b/core/src/lib.rs index ba3756d1..36a65462 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -28,6 +28,7 @@ extern crate rpassword; extern crate serde; extern crate serde_json; extern crate shannon; +extern crate tokio_codec; extern crate tokio_core; extern crate tokio_io; extern crate url;