mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
style: Fix a warning in Servo builds by moving a macro to where it's used.
This commit is contained in:
parent
8665d9dc12
commit
3da8f85914
1 changed files with 16 additions and 16 deletions
|
@ -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")]
|
#[cfg(feature = "gecko")]
|
||||||
impl fmt::Debug for UrlExtraData {
|
impl fmt::Debug for UrlExtraData {
|
||||||
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
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!(DebugURI, nsIURI, Gecko_nsIURI_Debug);
|
||||||
define_debug_struct!(DebugReferrerInfo, nsIReferrerInfo, Gecko_nsIReferrerInfo_Debug);
|
define_debug_struct!(DebugReferrerInfo, nsIReferrerInfo, Gecko_nsIReferrerInfo_Debug);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue