From 3da8f85914d28a35a7d060f1c715831435502454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 22 Jul 2019 12:53:09 +0200 Subject: [PATCH] style: Fix a warning in Servo builds by moving a macro to where it's used. --- components/style/stylesheets/mod.rs | 32 ++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/components/style/stylesheets/mod.rs b/components/style/stylesheets/mod.rs index 6c30de2c3a2..91d1bbc30c4 100644 --- a/components/style/stylesheets/mod.rs +++ b/components/style/stylesheets/mod.rs @@ -178,25 +178,25 @@ impl UrlExtraData { } } -macro_rules! define_debug_struct { - ($struct_name:ident, $gecko_class:ident, $debug_fn:ident) => { - struct $struct_name(*mut structs::$gecko_class); - impl fmt::Debug for $struct_name { - fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - use nsstring::nsCString; - let mut spec = nsCString::new(); - unsafe { - bindings::$debug_fn(self.0, &mut spec); - } - spec.fmt(formatter) - } - } - } -} - #[cfg(feature = "gecko")] impl fmt::Debug for UrlExtraData { fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + macro_rules! define_debug_struct { + ($struct_name:ident, $gecko_class:ident, $debug_fn:ident) => { + struct $struct_name(*mut structs::$gecko_class); + impl fmt::Debug for $struct_name { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + use nsstring::nsCString; + let mut spec = nsCString::new(); + unsafe { + bindings::$debug_fn(self.0, &mut spec); + } + spec.fmt(formatter) + } + } + } + } + define_debug_struct!(DebugURI, nsIURI, Gecko_nsIURI_Debug); define_debug_struct!(DebugReferrerInfo, nsIReferrerInfo, Gecko_nsIReferrerInfo_Debug);