mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-18 00:00:09 +02:00
fmt
This commit is contained in:
@@ -2,9 +2,7 @@ use crate::loom::sync::atomic::AtomicBool;
|
||||
use crate::loom::sync::Arc;
|
||||
use crate::runtime::driver::{self, Driver};
|
||||
use crate::runtime::scheduler::{self, Defer, Inject};
|
||||
use crate::runtime::task::{
|
||||
self, JoinHandle, OwnedTasks, Schedule, SpawnLocation, Task,
|
||||
};
|
||||
use crate::runtime::task::{self, JoinHandle, OwnedTasks, Schedule, SpawnLocation, Task};
|
||||
use crate::runtime::{
|
||||
blocking, context, Config, MetricsBatch, SchedulerMetrics, TaskHooks, TaskMeta, WorkerMetrics,
|
||||
};
|
||||
|
||||
@@ -127,8 +127,7 @@ impl<S: 'static> OwnedTasks<S> {
|
||||
T: Future + Send + 'static,
|
||||
T::Output: Send + 'static,
|
||||
{
|
||||
let (task, notified, join) =
|
||||
super::new_task(task, scheduler, id, spawned_at, user_data);
|
||||
let (task, notified, join) = super::new_task(task, scheduler, id, spawned_at, user_data);
|
||||
before_bind(&task);
|
||||
let notified = unsafe { self.bind_inner(task, notified) };
|
||||
(join, notified)
|
||||
@@ -183,8 +182,7 @@ impl<S: 'static> OwnedTasks<S> {
|
||||
T: Future + 'static,
|
||||
T::Output: 'static,
|
||||
{
|
||||
let (task, notified, join) =
|
||||
super::new_task(task, scheduler, id, spawned_at, user_data);
|
||||
let (task, notified, join) = super::new_task(task, scheduler, id, spawned_at, user_data);
|
||||
before_bind(&task);
|
||||
let notified = unsafe { self.bind_inner(task, notified) };
|
||||
(join, notified)
|
||||
|
||||
@@ -19,7 +19,6 @@ mod noop_scheduler {
|
||||
fn schedule(&self, _task: task::Notified<Self>) {
|
||||
unreachable!();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,15 +36,14 @@ mod unowned_wrapper {
|
||||
use tracing::Instrument;
|
||||
let span = tracing::trace_span!("test_span");
|
||||
let task = task.instrument(span);
|
||||
let (task, handle) =
|
||||
crate::runtime::task::unowned(
|
||||
task,
|
||||
NoopSchedule,
|
||||
Id::next(),
|
||||
SpawnLocation::capture(),
|
||||
#[cfg(tokio_unstable)]
|
||||
None,
|
||||
);
|
||||
let (task, handle) = crate::runtime::task::unowned(
|
||||
task,
|
||||
NoopSchedule,
|
||||
Id::next(),
|
||||
SpawnLocation::capture(),
|
||||
#[cfg(tokio_unstable)]
|
||||
None,
|
||||
);
|
||||
(task.into_notified(), handle)
|
||||
}
|
||||
|
||||
@@ -56,15 +54,14 @@ mod unowned_wrapper {
|
||||
T: std::future::Future + Send + 'static,
|
||||
T::Output: Send + 'static,
|
||||
{
|
||||
let (task, handle) =
|
||||
crate::runtime::task::unowned(
|
||||
task,
|
||||
NoopSchedule,
|
||||
Id::next(),
|
||||
SpawnLocation::capture(),
|
||||
#[cfg(tokio_unstable)]
|
||||
None,
|
||||
);
|
||||
let (task, handle) = crate::runtime::task::unowned(
|
||||
task,
|
||||
NoopSchedule,
|
||||
Id::next(),
|
||||
SpawnLocation::capture(),
|
||||
#[cfg(tokio_unstable)]
|
||||
None,
|
||||
);
|
||||
(task.into_notified(), handle)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -421,15 +421,14 @@ impl Runtime {
|
||||
T: 'static + Send + Future,
|
||||
T::Output: 'static + Send,
|
||||
{
|
||||
let (handle, notified) =
|
||||
self.0.owned.bind(
|
||||
future,
|
||||
self.clone(),
|
||||
Id::next(),
|
||||
SpawnLocation::capture(),
|
||||
#[cfg(tokio_unstable)]
|
||||
None,
|
||||
);
|
||||
let (handle, notified) = self.0.owned.bind(
|
||||
future,
|
||||
self.clone(),
|
||||
Id::next(),
|
||||
SpawnLocation::capture(),
|
||||
#[cfg(tokio_unstable)]
|
||||
None,
|
||||
);
|
||||
|
||||
if let Some(notified) = notified {
|
||||
self.schedule(notified);
|
||||
|
||||
Reference in New Issue
Block a user