aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/script/script_runtime.rs4
-rw-r--r--components/script/script_thread.rs7
2 files changed, 10 insertions, 1 deletions
diff --git a/components/script/script_runtime.rs b/components/script/script_runtime.rs
index 7236bc96ecc..d0473d2469c 100644
--- a/components/script/script_runtime.rs
+++ b/components/script/script_runtime.rs
@@ -50,7 +50,9 @@ impl fmt::Debug for CommonScriptMsg {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CommonScriptMsg::CollectReports(_) => write!(f, "CollectReports(...)"),
- CommonScriptMsg::RunnableMsg(category, _) => write!(f, "RunnableMsg({:?}, ...)", category),
+ CommonScriptMsg::RunnableMsg(ref category, ref runnable) => {
+ f.debug_tuple("RunnableMsg").field(category).field(runnable).finish()
+ },
}
}
}
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index b2359c3ea94..c15531ff595 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -102,6 +102,7 @@ use servo_url::{ImmutableOrigin, MutableOrigin, ServoUrl};
use std::cell::Cell;
use std::collections::{hash_map, HashMap, HashSet};
use std::default::Default;
+use std::fmt;
use std::intrinsics;
use std::ops::Deref;
use std::option::Option;
@@ -258,6 +259,12 @@ pub trait Runnable {
fn main_thread_handler(self: Box<Self>, _script_thread: &ScriptThread) { self.handler(); }
}
+impl fmt::Debug for Runnable + Send {
+ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+ fmt.debug_tuple(self.name()).field(&format_args!("...")).finish()
+ }
+}
+
#[derive(Debug)]
enum MixedMessage {
FromConstellation(ConstellationControlMsg),