From 939614bb6fc5de9c186247a18615b19babcddc29 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Fri, 1 Oct 2021 21:47:44 +0900 Subject: [PATCH] Fix clippy::redundant_closure warning --- futures-test/src/lib.rs | 1 + futures-util/src/future/future/shared.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/futures-test/src/lib.rs b/futures-test/src/lib.rs index 95528d5213..496252e720 100644 --- a/futures-test/src/lib.rs +++ b/futures-test/src/lib.rs @@ -15,6 +15,7 @@ ) ))] #![allow(clippy::if_then_panic)] + #[cfg(not(feature = "std"))] compile_error!( "`futures-test` must have the `std` feature activated, this is a default-active feature" diff --git a/futures-util/src/future/future/shared.rs b/futures-util/src/future/future/shared.rs index 9b31932fe3..d7ba49ec44 100644 --- a/futures-util/src/future/future/shared.rs +++ b/futures-util/src/future/future/shared.rs @@ -140,7 +140,7 @@ where /// can change the strong count at any time, including potentially between calling this method /// and acting on the result. pub fn strong_count(&self) -> Option { - self.inner.as_ref().map(|arc| Arc::strong_count(arc)) + self.inner.as_ref().map(Arc::strong_count) } /// Gets the number of weak pointers to this allocation. @@ -153,7 +153,7 @@ where /// can change the weak count at any time, including potentially between calling this method /// and acting on the result. pub fn weak_count(&self) -> Option { - self.inner.as_ref().map(|arc| Arc::weak_count(arc)) + self.inner.as_ref().map(Arc::weak_count) } }