mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Put the name of runnables in Debug for CommonScriptMsg
This commit is contained in:
parent
69275162b0
commit
7ca52152a6
2 changed files with 10 additions and 1 deletions
|
@ -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()
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue