Skip to content

Commit 4fa48ea

Browse files
committed
fix clippy
1 parent 7335ef3 commit 4fa48ea

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

core/src/common/ordered_work_steal.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ impl<'l, T: Debug> OrderedLocalQueue<'l, T> {
255255
for _ in 0..count {
256256
for entry in self.queue.iter().rev() {
257257
if let Some(item) = entry.value().pop() {
258-
self.shared.push_with_priority(entry.key().clone(), item);
258+
self.shared.push_with_priority(*entry.key(), item);
259259
}
260260
}
261261
}
@@ -350,7 +350,7 @@ impl<'l, T: Debug> OrderedLocalQueue<'l, T> {
350350
//其他队列为空
351351
continue;
352352
}
353-
let into_entry = self.queue.get_or_insert_with(entry.key().clone(), || {
353+
let into_entry = self.queue.get_or_insert_with(*entry.key(), || {
354354
Worker::new(self.shared.local_capacity)
355355
});
356356
let into_queue = into_entry.value();

core/src/coroutine/local.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use std::ffi::c_void;
44
use std::fmt::Debug;
55

66
/// todo provide macro like [`std::thread_local`]
7-
87
/// A struct for coroutines handles local args.
98
#[repr(C)]
109
#[derive(Debug, Default)]

core/src/coroutine/suspender.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl<Param, Yield> Suspender<'_, Param, Yield> {
4949
}
5050

5151
#[allow(clippy::must_use_candidate)]
52-
impl<'s, Param> Suspender<'s, Param, ()> {
52+
impl<Param> Suspender<'_, Param, ()> {
5353
/// see the `suspend_with` documents.
5454
pub fn suspend(&self) -> Param {
5555
self.suspend_with(())

core/src/syscall/unix/select.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl<I: SelectSyscall> SelectSyscall for NioSelectSyscall<I> {
9797
}
9898
_ = EventLoops::wait_event(Some(Duration::from_millis(u64::from(t.min(x)))));
9999
if t != c_uint::MAX {
100-
t = if t > x { t - x } else { 0 };
100+
t = t.saturating_sub(x);
101101
}
102102
if x < 16 {
103103
x <<= 1;

0 commit comments

Comments
 (0)