aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/task.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/task.rs')
-rw-r--r--components/script/task.rs18
1 files changed, 12 insertions, 6 deletions
diff --git a/components/script/task.rs b/components/script/task.rs
index eab786c8c20..8be1013063b 100644
--- a/components/script/task.rs
+++ b/components/script/task.rs
@@ -33,9 +33,13 @@ pub trait TaskOnce: Send {
#[allow(unsafe_code)]
fn name(&self) -> &'static str {
#[cfg(feature = "unstable")]
- unsafe { ::std::intrinsics::type_name::<Self>() }
+ unsafe {
+ ::std::intrinsics::type_name::<Self>()
+ }
#[cfg(not(feature = "unstable"))]
- { "(task name unknown)" }
+ {
+ "(task name unknown)"
+ }
}
fn run_once(self);
@@ -63,7 +67,9 @@ where
impl fmt::Debug for TaskBox {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
- fmt.debug_tuple(self.name()).field(&format_args!("...")).finish()
+ fmt.debug_tuple(self.name())
+ .field(&format_args!("..."))
+ .finish()
}
}
@@ -97,9 +103,9 @@ where
T: TaskOnce,
{
fn is_cancelled(&self) -> bool {
- self.cancelled.as_ref().map_or(false, |cancelled| {
- cancelled.load(Ordering::SeqCst)
- })
+ self.cancelled
+ .as_ref()
+ .map_or(false, |cancelled| cancelled.load(Ordering::SeqCst))
}
}