From 2fe4313af32b7175a4acabf501cbcbc6ea519e48 Mon Sep 17 00:00:00 2001 From: Weijia Jiang Date: Sun, 10 Sep 2023 09:07:53 +0800 Subject: [PATCH] rm more generics parameter --- tokio/src/runtime/scheduler/inject/metrics.rs | 2 +- tokio/src/runtime/scheduler/multi_thread/queue.rs | 2 +- .../src/runtime/scheduler/multi_thread/worker/taskdump.rs | 2 +- .../runtime/scheduler/multi_thread_alt/worker/taskdump.rs | 2 +- tokio/src/runtime/task/list.rs | 2 +- tokio/src/runtime/task/trace/mod.rs | 8 ++++---- tokio/src/runtime/tests/loom_multi_thread/queue.rs | 2 +- tokio/src/runtime/tests/loom_multi_thread_alt/queue.rs | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tokio/src/runtime/scheduler/inject/metrics.rs b/tokio/src/runtime/scheduler/inject/metrics.rs index 76f045fdbd6..2a245d4251a 100644 --- a/tokio/src/runtime/scheduler/inject/metrics.rs +++ b/tokio/src/runtime/scheduler/inject/metrics.rs @@ -1,6 +1,6 @@ use super::Inject; -impl Inject { +impl Inject { pub(crate) fn len(&self) -> usize { self.shared.len() } diff --git a/tokio/src/runtime/scheduler/multi_thread/queue.rs b/tokio/src/runtime/scheduler/multi_thread/queue.rs index c7611e75475..1c42faeceef 100644 --- a/tokio/src/runtime/scheduler/multi_thread/queue.rs +++ b/tokio/src/runtime/scheduler/multi_thread/queue.rs @@ -547,7 +547,7 @@ impl Steal { } cfg_metrics! { - impl Steal { + impl Steal { pub(crate) fn len(&self) -> usize { self.0.len() as _ } diff --git a/tokio/src/runtime/scheduler/multi_thread/worker/taskdump.rs b/tokio/src/runtime/scheduler/multi_thread/worker/taskdump.rs index d310d9f6d35..39bba73576c 100644 --- a/tokio/src/runtime/scheduler/multi_thread/worker/taskdump.rs +++ b/tokio/src/runtime/scheduler/multi_thread/worker/taskdump.rs @@ -59,7 +59,7 @@ impl Handle { impl Shared { /// Steal all tasks from remotes into a single local queue. - pub(super) fn steal_all(&self) -> super::queue::Local> { + pub(super) fn steal_all(&self) -> super::queue::Local { let (_steal, mut local) = super::queue::local(); let worker_metrics = WorkerMetrics::new(); diff --git a/tokio/src/runtime/scheduler/multi_thread_alt/worker/taskdump.rs b/tokio/src/runtime/scheduler/multi_thread_alt/worker/taskdump.rs index 7cf69c43ddc..b16160ee90a 100644 --- a/tokio/src/runtime/scheduler/multi_thread_alt/worker/taskdump.rs +++ b/tokio/src/runtime/scheduler/multi_thread_alt/worker/taskdump.rs @@ -59,7 +59,7 @@ impl Handle { impl Shared { /// Steal all tasks from remotes into a single local queue. - pub(super) fn steal_all(&self) -> super::queue::Local> { + pub(super) fn steal_all(&self) -> super::queue::Local { let (_steal, mut local) = super::queue::local(); let worker_metrics = WorkerMetrics::new(); diff --git a/tokio/src/runtime/task/list.rs b/tokio/src/runtime/task/list.rs index 514dd1e05c6..44bba71e1a1 100644 --- a/tokio/src/runtime/task/list.rs +++ b/tokio/src/runtime/task/list.rs @@ -195,7 +195,7 @@ cfg_taskdump! { /// Locks the tasks, and calls `f` on an iterator over them. pub(crate) fn for_each(&self, f: F) where - F: FnMut(&Task) + F: FnMut(&Task) { self.inner.lock().list.for_each(f) } diff --git a/tokio/src/runtime/task/trace/mod.rs b/tokio/src/runtime/task/trace/mod.rs index af2c5644b1a..480d13e88d7 100644 --- a/tokio/src/runtime/task/trace/mod.rs +++ b/tokio/src/runtime/task/trace/mod.rs @@ -258,8 +258,8 @@ impl Future for Root { /// Trace and poll all tasks of the current_thread runtime. pub(in crate::runtime) fn trace_current_thread( owned: &OwnedTasks>, - local: &mut VecDeque>>, - injection: &Inject>, + local: &mut VecDeque, + injection: &Inject, ) -> Vec { // clear the local and injection queues local.clear(); @@ -299,9 +299,9 @@ cfg_rt_multi_thread! { /// Must be called with the same `synced` that `injection` was created with. pub(in crate::runtime) unsafe fn trace_multi_thread( owned: &OwnedTasks>, - local: &mut multi_thread::queue::Local>, + local: &mut multi_thread::queue::Local, synced: &Mutex, - injection: &Shared>, + injection: &Shared, ) -> Vec { // clear the local queue while let Some(notified) = local.pop() { diff --git a/tokio/src/runtime/tests/loom_multi_thread/queue.rs b/tokio/src/runtime/tests/loom_multi_thread/queue.rs index 0d818283653..cbb16631b31 100644 --- a/tokio/src/runtime/tests/loom_multi_thread/queue.rs +++ b/tokio/src/runtime/tests/loom_multi_thread/queue.rs @@ -116,7 +116,7 @@ fn steal_overflow() { fn multi_stealer() { const NUM_TASKS: usize = 5; - fn steal_tasks(steal: queue::Steal) -> usize { + fn steal_tasks(steal: queue::Steal) -> usize { let mut stats = new_stats(); let (_, mut local) = queue::local(); diff --git a/tokio/src/runtime/tests/loom_multi_thread_alt/queue.rs b/tokio/src/runtime/tests/loom_multi_thread_alt/queue.rs index 0d818283653..cbb16631b31 100644 --- a/tokio/src/runtime/tests/loom_multi_thread_alt/queue.rs +++ b/tokio/src/runtime/tests/loom_multi_thread_alt/queue.rs @@ -116,7 +116,7 @@ fn steal_overflow() { fn multi_stealer() { const NUM_TASKS: usize = 5; - fn steal_tasks(steal: queue::Steal) -> usize { + fn steal_tasks(steal: queue::Steal) -> usize { let mut stats = new_stats(); let (_, mut local) = queue::local();