Skip to content

Commit

Permalink
rm more generics parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
wathenjiang committed Sep 10, 2023
1 parent d10cbe7 commit 2fe4313
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion tokio/src/runtime/scheduler/inject/metrics.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::Inject;

impl<T: 'static> Inject<T> {
impl Inject {
pub(crate) fn len(&self) -> usize {
self.shared.len()
}
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/runtime/scheduler/multi_thread/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ impl Steal {
}

cfg_metrics! {
impl<T> Steal<T> {
impl Steal {
pub(crate) fn len(&self) -> usize {
self.0.len() as _
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Arc<Handle>> {
pub(super) fn steal_all(&self) -> super::queue::Local {
let (_steal, mut local) = super::queue::local();

let worker_metrics = WorkerMetrics::new();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Arc<Handle>> {
pub(super) fn steal_all(&self) -> super::queue::Local {
let (_steal, mut local) = super::queue::local();

let worker_metrics = WorkerMetrics::new();
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/runtime/task/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ cfg_taskdump! {
/// Locks the tasks, and calls `f` on an iterator over them.
pub(crate) fn for_each<F>(&self, f: F)
where
F: FnMut(&Task<S>)
F: FnMut(&Task)
{
self.inner.lock().list.for_each(f)
}
Expand Down
8 changes: 4 additions & 4 deletions tokio/src/runtime/task/trace/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ impl<T: Future> Future for Root<T> {
/// Trace and poll all tasks of the current_thread runtime.
pub(in crate::runtime) fn trace_current_thread(
owned: &OwnedTasks<Arc<current_thread::Handle>>,
local: &mut VecDeque<Notified<Arc<current_thread::Handle>>>,
injection: &Inject<Arc<current_thread::Handle>>,
local: &mut VecDeque<Notified>,
injection: &Inject,
) -> Vec<Trace> {
// clear the local and injection queues
local.clear();
Expand Down Expand Up @@ -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<Arc<multi_thread::Handle>>,
local: &mut multi_thread::queue::Local<Arc<multi_thread::Handle>>,
local: &mut multi_thread::queue::Local,
synced: &Mutex<Synced>,
injection: &Shared<Arc<multi_thread::Handle>>,
injection: &Shared,
) -> Vec<Trace> {
// clear the local queue
while let Some(notified) = local.pop() {
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/runtime/tests/loom_multi_thread/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ fn steal_overflow() {
fn multi_stealer() {
const NUM_TASKS: usize = 5;

fn steal_tasks(steal: queue::Steal<NoopSchedule>) -> usize {
fn steal_tasks(steal: queue::Steal) -> usize {
let mut stats = new_stats();
let (_, mut local) = queue::local();

Expand Down
2 changes: 1 addition & 1 deletion tokio/src/runtime/tests/loom_multi_thread_alt/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ fn steal_overflow() {
fn multi_stealer() {
const NUM_TASKS: usize = 5;

fn steal_tasks(steal: queue::Steal<NoopSchedule>) -> usize {
fn steal_tasks(steal: queue::Steal) -> usize {
let mut stats = new_stats();
let (_, mut local) = queue::local();

Expand Down

0 comments on commit 2fe4313

Please sign in to comment.