mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Format script component
This commit is contained in:
parent
2ca7a13473
commit
c37a345dc9
357 changed files with 25485 additions and 18076 deletions
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue