style: Fix a warning in Servo builds by moving a macro to where it's used.

This commit is contained in:
Emilio Cobos Álvarez 2019-07-22 12:53:09 +02:00
parent 8665d9dc12
commit 3da8f85914
No known key found for this signature in database
GPG key ID: E1152D0994E4BF8A

View file

@ -178,6 +178,9 @@ impl UrlExtraData {
}
}
#[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);
@ -194,9 +197,6 @@ macro_rules! define_debug_struct {
}
}
#[cfg(feature = "gecko")]
impl fmt::Debug for UrlExtraData {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
define_debug_struct!(DebugURI, nsIURI, Gecko_nsIURI_Debug);
define_debug_struct!(DebugReferrerInfo, nsIReferrerInfo, Gecko_nsIReferrerInfo_Debug);