From a47e94c8f6b37de9845c824c6a8a488728a1d0c1 Mon Sep 17 00:00:00 2001 From: Alan Jeffrey Date: Tue, 13 Jun 2017 10:46:59 -0500 Subject: Added Debug implementations. --- components/script/script_runtime.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'components/script/script_runtime.rs') diff --git a/components/script/script_runtime.rs b/components/script/script_runtime.rs index 8c243b18695..efbdb6bdc40 100644 --- a/components/script/script_runtime.rs +++ b/components/script/script_runtime.rs @@ -27,6 +27,7 @@ use script_thread::{Runnable, STACK_ROOTS, trace_thread}; use servo_config::opts; use servo_config::prefs::PREFS; use std::cell::Cell; +use std::fmt; use std::io::{Write, stdout}; use std::marker::PhantomData; use std::os; @@ -45,6 +46,15 @@ pub enum CommonScriptMsg { RunnableMsg(ScriptThreadEventCategory, Box), } +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), + } + } +} + /// A cloneable interface for communicating with an event loop. pub trait ScriptChan: JSTraceable { /// Send a message to the associated event loop. -- cgit v1.2.3