From 84f5eea5f6795b3584dc5f2128c01fba371b6952 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 8 Sep 2023 22:07:19 +0330 Subject: [PATCH] resolve comments --- tokio/src/sync/semaphore.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tokio/src/sync/semaphore.rs b/tokio/src/sync/semaphore.rs index ee96d6fc9c8..189136228a9 100644 --- a/tokio/src/sync/semaphore.rs +++ b/tokio/src/sync/semaphore.rs @@ -139,7 +139,7 @@ use std::sync::Arc; /// interval.tick().await; /// /// let cap = rate - sem.available_permits(); -/// sem.add_permits(std::cmp::min(cap, 1)); +/// sem.add_permits(cap.min(1)); /// } /// } /// });