Skip to content

Commit 2091686

Browse files
committed
tidy
1 parent f2b5e27 commit 2091686

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

library/std/src/sync/mpmc/array.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ impl<T> Channel<T> {
169169
}
170170
Err(_) => {
171171
backoff.spin();
172-
tail = self.load(Ordering::Relaxed);
172+
tail = self.tail.load(Ordering::Relaxed);
173173
}
174174
}
175175
} else if stamp.wrapping_add(self.one_lap) == tail + 1 {
@@ -250,7 +250,7 @@ impl<T> Channel<T> {
250250
token.array.stamp = head.wrapping_add(self.one_lap);
251251
return true;
252252
}
253-
Err(h) => {
253+
Err(_) => {
254254
backoff.spin();
255255
head = self.head.load(Ordering::Relaxed);
256256
}

library/std/src/sync/mpmc/context.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! Thread-local channel context.
22
33
use super::select::Selected;
4-
use super::utils::Backoff;
54

65
use crate::cell::Cell;
76
use crate::ptr;

library/std/src/sync/mpmc/list.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ impl<T> Channel<T> {
350350
token.list.offset = offset;
351351
return true;
352352
},
353-
Err(h) => {
353+
Err(_) => {
354354
backoff.spin();
355355
head = self.head.index.load(Ordering::Acquire);
356356
block = self.head.block.load(Ordering::Acquire);

library/std/src/sync/mpmc/utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl Backoff {
111111
#[inline]
112112
pub fn spin(&self) {
113113
let step = self.step.get().min(SPIN_LIMIT);
114-
for _ in 0..step.pow(2) {
114+
for _ in 0..step.pow(2) {
115115
crate::hint::spin_loop();
116116
}
117117

0 commit comments

Comments
 (0)