mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-07 00:00:08 +02:00
Update Tokio to Rust 2018 (#1082)
This commit is contained in:
@@ -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()?
|
||||
|
||||
@@ -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)?;
|
||||
|
||||
Reference in New Issue
Block a user