Update Tokio to Rust 2018 (#1082)

This commit is contained in:
Carl Lerche
2019-05-14 10:27:36 -07:00
committed by GitHub
parent 79d8820050
commit cb4aea394e
343 changed files with 1725 additions and 2813 deletions
+6 -9
View File
@@ -1,18 +1,15 @@
extern crate futures;
extern crate native_tls;
extern crate tokio;
extern crate tokio_io;
extern crate tokio_tls;
use std::io;
use std::net::ToSocketAddrs;
#![deny(warnings, rust_2018_idioms)]
use futures::Future;
use native_tls::TlsConnector;
use std::io;
use std::net::ToSocketAddrs;
use tokio::net::TcpStream;
use tokio::runtime::Runtime;
use tokio_io;
use tokio_tls;
fn main() -> Result<(), Box<std::error::Error>> {
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut runtime = Runtime::new()?;
let addr = "www.rust-lang.org:443"
.to_socket_addrs()?
+6 -5
View File
@@ -1,14 +1,15 @@
// A tiny async TLS echo server with Tokio
extern crate native_tls;
extern crate tokio;
extern crate tokio_tls;
#![deny(warnings, rust_2018_idioms)]
// A tiny async TLS echo server with Tokio
use native_tls;
use native_tls::Identity;
use tokio;
use tokio::io;
use tokio::net::TcpListener;
use tokio::prelude::*;
use tokio_tls;
fn main() -> Result<(), Box<std::error::Error>> {
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Bind the server's socket
let addr = "127.0.0.1:12345".parse()?;
let tcp = TcpListener::bind(&addr)?;