Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Match on result (input) not stream (output)
  • Loading branch information
ryanbrainard committed Aug 2, 2020
commit c5631996c9a40d14a81762b5770097471654caa8
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