From 4e4eb10ffc768a51fb68d2a5b79f9266f024a72b Mon Sep 17 00:00:00 2001 From: Tetsuharu OHZEKI Date: Sat, 23 Nov 2013 12:14:00 +0900 Subject: [PATCH] Use 'DOMString' to define the type insteand of '~str'. At now, 'DOMString' is equal to '~str'. https://github.com/mozilla/servo/blob/155befe10dc56cfb2dfbf0cca7b652293dba9753/src/components/script/dom/bindings/utils.rs#L119 --- src/components/script/dom/document.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/script/dom/document.rs b/src/components/script/dom/document.rs index 4df11e57754..08a0ee45763 100644 --- a/src/components/script/dom/document.rs +++ b/src/components/script/dom/document.rs @@ -92,7 +92,7 @@ pub struct Document { window: @mut Window, doctype: DocumentType, title: ~str, - idmap: HashMap<~str, AbstractNode> + idmap: HashMap> } impl Document { @@ -326,7 +326,7 @@ impl Document { } pub fn register_nodes_with_id(&mut self, root: &AbstractNode) { - foreach_ided_elements(root, |id: &~str, abstract_node: &AbstractNode| { + foreach_ided_elements(root, |id: &DOMString, abstract_node: &AbstractNode| { // TODO: "in tree order, within the context object's tree" // http://dom.spec.whatwg.org/#dom-document-getelementbyid. self.idmap.find_or_insert(id.clone(), *abstract_node); @@ -334,7 +334,7 @@ impl Document { } pub fn unregister_nodes_with_id(&mut self, root: &AbstractNode) { - foreach_ided_elements(root, |id: &~str, _| { + foreach_ided_elements(root, |id: &DOMString, _| { // TODO: "in tree order, within the context object's tree" // http://dom.spec.whatwg.org/#dom-document-getelementbyid. self.idmap.pop(id); @@ -366,7 +366,7 @@ impl Document { #[inline(always)] fn foreach_ided_elements(root: &AbstractNode, - callback: &fn(&~str, &AbstractNode)) { + callback: &fn(&DOMString, &AbstractNode)) { for node in root.traverse_preorder() { if !node.is_element() { continue;