mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Add some fmt::Debug implementations
This commit is contained in:
parent
477cae67df
commit
bc71e8b65b
7 changed files with 59 additions and 4 deletions
|
@ -79,6 +79,7 @@ use std::borrow::Cow;
|
|||
use std::cell::{Cell, Ref};
|
||||
use std::convert::TryFrom;
|
||||
use std::default::Default;
|
||||
use std::fmt;
|
||||
use std::mem;
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
|
@ -115,6 +116,16 @@ pub struct Element {
|
|||
atomic_flags: AtomicElementFlags,
|
||||
}
|
||||
|
||||
impl fmt::Debug for Element {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
try!(write!(f, "<{}", self.local_name));
|
||||
if let Some(ref id) = *self.id_attribute.borrow() {
|
||||
try!(write!(f, " id={}", id));
|
||||
}
|
||||
write!(f, ">")
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, HeapSizeOf)]
|
||||
pub enum ElementCreator {
|
||||
ParserCreated,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue