From ef13f01b8ef029a0d15019c7a81549c7ae393f85 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Tue, 3 Jan 2017 13:58:18 +0100 Subject: [PATCH] Simplify ConstellationControlMsg's Debug implementation. --- components/script_traits/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index 56d4406f1ce..4cf005c93f2 100644 --- a/components/script_traits/lib.rs +++ b/components/script_traits/lib.rs @@ -258,7 +258,7 @@ pub enum ConstellationControlMsg { impl fmt::Debug for ConstellationControlMsg { fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { use self::ConstellationControlMsg::*; - write!(formatter, "ConstellationMsg::{}", match *self { + let variant = match *self { AttachLayout(..) => "AttachLayout", Resize(..) => "Resize", ResizeInactive(..) => "ResizeInactive", @@ -285,7 +285,8 @@ impl fmt::Debug for ConstellationControlMsg { FramedContentChanged(..) => "FramedContentChanged", ReportCSSError(..) => "ReportCSSError", Reload(..) => "Reload" - }) + }; + write!(formatter, "ConstellationMsg::{}", variant) } }