chore: fix compile error on latest nightly (#1512)

This commit is contained in:
kellerkindt
2019-08-30 09:15:05 -07:00
committed by Carl Lerche
parent 3d9134d13e
commit 4f99470d46
+4 -2
View File
@@ -57,11 +57,12 @@ A basic TCP echo server with Tokio:
```rust ```rust
use tokio::net::TcpListener; use tokio::net::TcpListener;
use tokio::prelude::*; use tokio::prelude::*;
use std::net::SocketAddr;
#[tokio::main] #[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> { async fn main() -> Result<(), Box<dyn std::error::Error>> {
let addr = "127.0.0.1:8080".parse()?; let addr = "127.0.0.1:8080".parse::<SocketAddr>()?;
let mut listener = TcpListener::bind(&addr).unwrap(); let mut listener = TcpListener::bind(&addr).await?;
loop { loop {
let (mut socket, _) = listener.accept().await?; let (mut socket, _) = listener.accept().await?;
@@ -90,6 +91,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
}); });
} }
} }
``` ```
More examples can be found [here](tokio/examples). Note that the `master` branch More examples can be found [here](tokio/examples). Note that the `master` branch