aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/task.rs
diff options
context:
space:
mode:
authorchansuke <chansuke@georepublic.de>2018-09-18 23:24:15 +0900
committerJosh Matthews <josh@joshmatthews.net>2018-09-19 17:40:47 -0400
commitc37a345dc9f4dda6ea29c42f96f6c7201c42cbac (patch)
tree1f05b49bac02318455a59d5b143c186fd872bdb9 /components/script/task.rs
parent2ca7a134736bb4759ff209c1bc0b6dc3cc1984c9 (diff)
downloadservo-c37a345dc9f4dda6ea29c42f96f6c7201c42cbac.tar.gz
servo-c37a345dc9f4dda6ea29c42f96f6c7201c42cbac.zip
Format script component
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))
}
}