From 83d82f97eb7f5de14c27c93f3305c22a04c4b0f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Alejandro=20Engu=C3=ADdanos=20Nebot?= Date: Mon, 17 Jul 2023 10:13:14 +0200 Subject: [PATCH] sync: fix clippy warning in docs (#5873) --- tokio/src/sync/mpsc/bounded.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tokio/src/sync/mpsc/bounded.rs b/tokio/src/sync/mpsc/bounded.rs index e870ae5f4..512cca502 100644 --- a/tokio/src/sync/mpsc/bounded.rs +++ b/tokio/src/sync/mpsc/bounded.rs @@ -128,9 +128,9 @@ pub struct Receiver { /// /// tokio::spawn(async move { /// for i in 0..10 { -/// if let Err(_) = tx.send(i).await { +/// if tx.send(i).await.is_err() { /// println!("receiver dropped"); -/// return; +/// break; /// } /// } /// }); @@ -459,9 +459,9 @@ impl Sender { /// /// tokio::spawn(async move { /// for i in 0..10 { - /// if let Err(_) = tx.send(i).await { + /// if tx.send(i).await.is_err() { /// println!("receiver dropped"); - /// return; + /// break; /// } /// } /// }); @@ -630,7 +630,7 @@ impl Sender { /// for i in 0..10 { /// if let Err(e) = tx.send_timeout(i, Duration::from_millis(100)).await { /// println!("send error: #{:?}", e); - /// return; + /// break; /// } /// } /// });