From eb4c6936cf4541a369185ced7291852e37edfe28 Mon Sep 17 00:00:00 2001 From: Sergey Kaunov Date: Wed, 4 Oct 2023 15:25:40 +0300 Subject: [PATCH] Clarify variable naming in async.md (#718) It's a little bit confusing for a newcomer that notify one method is called on notify two -- it gives wrong hint/intuition to some readers, so it worth to choose a name which won't suggest such semantic, which isn't there. Looks like this part of code is only in tutorial text, and nothing to sync in the supplementary code. --- content/tokio/tutorial/async.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/tokio/tutorial/async.md b/content/tokio/tutorial/async.md index 728908b0..f0ba7bc6 100644 --- a/content/tokio/tutorial/async.md +++ b/content/tokio/tutorial/async.md @@ -792,7 +792,7 @@ use std::thread; async fn delay(dur: Duration) { let when = Instant::now() + dur; let notify = Arc::new(Notify::new()); - let notify2 = notify.clone(); + let notify_clone = notify.clone(); thread::spawn(move || { let now = Instant::now(); @@ -801,7 +801,7 @@ async fn delay(dur: Duration) { thread::sleep(when - now); } - notify2.notify_one(); + notify_clone.notify_one(); });