diff options
author | Jack Moffitt <jack@metajack.im> | 2014-11-05 12:33:11 -0700 |
---|---|---|
committer | Glenn Watson <gw@intuitionlibrary.com> | 2014-11-13 11:17:43 +1000 |
commit | d1b433a3b3bab353f320b2f39fa953ce326d2d55 (patch) | |
tree | d7a197abb65827b36c47e6b5c3adcce9071643d3 /components/script/dom/htmlserializer.rs | |
parent | 26045d7fcbab8851fbefe2851cd904203f8fd8dd (diff) | |
download | servo-d1b433a3b3bab353f320b2f39fa953ce326d2d55.tar.gz servo-d1b433a3b3bab353f320b2f39fa953ce326d2d55.zip |
Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a
Diffstat (limited to 'components/script/dom/htmlserializer.rs')
-rw-r--r-- | components/script/dom/htmlserializer.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/components/script/dom/htmlserializer.rs b/components/script/dom/htmlserializer.rs index e9de8987ac0..38a56feb23e 100644 --- a/components/script/dom/htmlserializer.rs +++ b/components/script/dom/htmlserializer.rs @@ -55,7 +55,7 @@ pub fn serialize(iterator: &mut NodeIterator) -> String { } DocumentFragmentNodeTypeId => {} DocumentNodeTypeId => { - fail!("It shouldn't be possible to serialize a document node") + panic!("It shouldn't be possible to serialize a document node") } } } @@ -94,7 +94,7 @@ fn serialize_processing_instruction(processing_instruction: JSRef<ProcessingInst html: &mut String) { html.push_str("<?"); html.push_str(processing_instruction.target().as_slice()); - html.push_char(' '); + html.push(' '); html.push_str(processing_instruction.characterdata().data().as_slice()); html.push_str("?>"); } @@ -102,17 +102,17 @@ fn serialize_processing_instruction(processing_instruction: JSRef<ProcessingInst fn serialize_doctype(doctype: JSRef<DocumentType>, html: &mut String) { html.push_str("<!DOCTYPE"); html.push_str(doctype.name().as_slice()); - html.push_char('>'); + html.push('>'); } fn serialize_elem(elem: JSRef<Element>, open_elements: &mut Vec<String>, html: &mut String) { - html.push_char('<'); + html.push('<'); html.push_str(elem.local_name().as_slice()); for attr in elem.attrs().iter() { let attr = attr.root(); serialize_attr(*attr, html); }; - html.push_char('>'); + html.push('>'); match elem.local_name().as_slice() { "pre" | "listing" | "textarea" if *elem.namespace() == ns!(HTML) => { @@ -121,7 +121,7 @@ fn serialize_elem(elem: JSRef<Element>, open_elements: &mut Vec<String>, html: & Some(ref child) if child.is_text() => { let text: JSRef<CharacterData> = CharacterDataCast::to_ref(**child).unwrap(); if text.data().len() > 0 && text.data().as_slice().char_at(0) == '\n' { - html.push_char('\x0A'); + html.push('\x0A'); } }, _ => {} @@ -136,7 +136,7 @@ fn serialize_elem(elem: JSRef<Element>, open_elements: &mut Vec<String>, html: & } fn serialize_attr(attr: JSRef<Attr>, html: &mut String) { - html.push_char(' '); + html.push(' '); if *attr.namespace() == ns!(XML) { html.push_str("xml:"); html.push_str(attr.local_name().as_slice()); @@ -154,18 +154,18 @@ fn serialize_attr(attr: JSRef<Attr>, html: &mut String) { }; html.push_str("=\""); escape(attr.value().as_slice(), true, html); - html.push_char('"'); + html.push('"'); } fn escape(string: &str, attr_mode: bool, html: &mut String) { for c in string.chars() { match c { '&' => html.push_str("&"), - '\xA0' => html.push_str(" "), + '\u00A0' => html.push_str(" "), '"' if attr_mode => html.push_str("""), '<' if !attr_mode => html.push_str("<"), '>' if !attr_mode => html.push_str(">"), - c => html.push_char(c), + c => html.push(c), } } } |