From 40837e480595daf7c90228d0ed935cebdc526ecb Mon Sep 17 00:00:00 2001 From: quininer Date: Sat, 24 Mar 2018 11:28:45 +0800 Subject: [PATCH] fix client example --- examples/client/Cargo.toml | 4 +++- examples/client/src/main.rs | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/client/Cargo.toml b/examples/client/Cargo.toml index 790b018..8cbf6c8 100644 --- a/examples/client/Cargo.toml +++ b/examples/client/Cargo.toml @@ -10,7 +10,9 @@ tokio-rustls = { path = "../..", default-features = false, features = [ "tokio" tokio = "0.1" tokio-core = "0.1" -tokio-file-unix = "0.4" clap = "2.26" webpki-roots = "0.14" + +[target.'cfg(unix)'.dependencies] +tokio-file-unix = "0.4" diff --git a/examples/client/src/main.rs b/examples/client/src/main.rs index 444bc18..e9171a4 100644 --- a/examples/client/src/main.rs +++ b/examples/client/src/main.rs @@ -19,9 +19,6 @@ use clap::{ App, Arg }; use rustls::ClientConfig; use tokio_rustls::ClientConfigExt; -#[cfg(not(unix))] -use std::io::{Read, Write}; - fn app() -> App<'static, 'static> { App::new("client") .about("tokio-rustls client example") @@ -95,6 +92,7 @@ fn main() { // The network I/O will still be asynchronous and non-blocking. #[cfg(not(unix))] { + use std::io::{ Read, Write }; use tokio::net::TcpStream; let socket = TcpStream::connect(&addr);