Skip to content

Commit

Permalink
Match on result (input) not stream (output)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanbrainard committed Aug 2, 2020
1 parent f9c8974 commit c563199
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/src/patterns/accept-loop.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c563199

Please sign in to comment.