From 5d67b2c7c648b829042c5275b96a1134e768da68 Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Tue, 19 Sep 2023 23:09:53 +0200 Subject: [PATCH] Use wildcard import to reduce diff --- tokio/src/sync/watch.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tokio/src/sync/watch.rs b/tokio/src/sync/watch.rs index edd39ad5f74..5b08dda91c4 100644 --- a/tokio/src/sync/watch.rs +++ b/tokio/src/sync/watch.rs @@ -114,7 +114,7 @@ use crate::sync::notify::Notify; use crate::loom::sync::atomic::AtomicUsize; -use crate::loom::sync::atomic::Ordering; +use crate::loom::sync::atomic::Ordering::*; use crate::loom::sync::{Arc, RwLock, RwLockReadGuard}; use std::fmt; use std::mem; @@ -248,7 +248,7 @@ struct Shared { impl fmt::Debug for Shared { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { // Using `Relaxed` ordering is sufficient for this purpose. - let state = self.state.load(Ordering::Relaxed); + let state = self.state.load(Relaxed); f.debug_struct("Shared") .field("value", &self.value) .field("version", &state.version()) @@ -509,7 +509,7 @@ impl Receiver { fn from_shared(version: Version, shared: Arc>) -> Self { // No synchronization necessary as this is only used as a counter and // not memory access. - shared.ref_count_rx.fetch_add(1, Ordering::Relaxed); + shared.ref_count_rx.fetch_add(1, Relaxed); Self { shared, version } } @@ -885,7 +885,7 @@ impl Drop for Receiver { fn drop(&mut self) { // No synchronization necessary as this is only used as a counter and // not memory access. - if 1 == self.shared.ref_count_rx.fetch_sub(1, Ordering::Relaxed) { + if 1 == self.shared.ref_count_rx.fetch_sub(1, Relaxed) { // This is the last `Receiver` handle, tasks waiting on `Sender::closed()` self.shared.notify_tx.notify_waiters(); } @@ -1274,7 +1274,7 @@ impl Sender { /// } /// ``` pub fn receiver_count(&self) -> usize { - self.shared.ref_count_rx.load(Ordering::Relaxed) + self.shared.ref_count_rx.load(Relaxed) } }