2
0
Fork 1
mirror of https://github.com/async-rs/async-std.git synced 2025-01-30 01:05:31 +00:00

Match on result (input) not stream (output)

This commit is contained in:
Ryan Brainard 2020-08-02 17:49:19 +09:00
parent f9c8974206
commit c5631996c9

View file

@ -121,7 +121,7 @@ async fn accept_loop(addr: impl ToSocketAddrs) -> Result<()> {
let listener = TcpListener::bind(addr).await?;
let mut incoming = listener.incoming();
while let Some(result) = incoming.next().await {
let stream = match stream {
let stream = match result {
Err(ref e) if is_connection_error(e) => continue, // 1
Err(e) => {
eprintln!("Error: {}. Pausing for 500ms."); // 3