Skip to content

Commit c563199

Browse files
committed
Match on result (input) not stream (output)
1 parent f9c8974 commit c563199

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/src/patterns/accept-loop.md

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

0 commit comments

Comments
 (0)