Put the name of runnables in Debug for CommonScriptMsg

This commit is contained in:
Anthony Ramine 2017-09-16 01:25:51 +02:00
parent 69275162b0
commit 7ca52152a6
2 changed files with 10 additions and 1 deletions

View file

@ -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),