script: to_string() -> into_string()

This commit is contained in:
Manish Goregaokar 2014-12-14 04:16:34 +05:30 committed by Ms2ger
parent 475ff4dcb7
commit e9d1740e19
39 changed files with 152 additions and 152 deletions

View file

@ -843,17 +843,17 @@ impl<'a> NodeHelpers<'a> for JSRef<'a, Node> {
NodeInfo {
uniqueId: self.unique_id.borrow().clone(),
baseURI: self.GetBaseURI().unwrap_or("".to_string()),
parent: self.GetParentNode().root().map(|node| node.get_unique_id()).unwrap_or("".to_string()),
baseURI: self.GetBaseURI().unwrap_or("".into_string()),
parent: self.GetParentNode().root().map(|node| node.get_unique_id()).unwrap_or("".into_string()),
nodeType: self.NodeType() as uint,
namespaceURI: "".to_string(), //FIXME
namespaceURI: "".into_string(), //FIXME
nodeName: self.NodeName(),
numChildren: self.ChildNodes().root().Length() as uint,
//FIXME doctype nodes only
name: "".to_string(),
publicId: "".to_string(),
systemId: "".to_string(),
name: "".into_string(),
publicId: "".into_string(),
systemId: "".into_string(),
attrs: match ElementCast::to_ref(self) {
Some(element) => element.summarize(),
@ -866,7 +866,7 @@ impl<'a> NodeHelpers<'a> for JSRef<'a, Node> {
.map(|elem| NodeCast::from_ref(*elem.root()) == self)
.unwrap_or(false),
shortValue: self.GetNodeValue().unwrap_or("".to_string()), //FIXME: truncate
shortValue: self.GetNodeValue().unwrap_or("".into_string()), //FIXME: truncate
incompleteValue: false, //FIXME: reflect truncation
}
}
@ -1551,7 +1551,7 @@ impl Node {
local: element.local_name().clone()
};
let element = Element::create(name,
element.prefix().as_ref().map(|p| p.as_slice().to_string()),
element.prefix().as_ref().map(|p| p.as_slice().into_string()),
*document, ElementCreator::ScriptCreated);
NodeCast::from_temporary(element)
},
@ -1664,19 +1664,19 @@ impl<'a> NodeMethods for JSRef<'a, Node> {
let elem: JSRef<Element> = ElementCast::to_ref(self).unwrap();
elem.TagName()
}
NodeTypeId::Text => "#text".to_string(),
NodeTypeId::Text => "#text".into_string(),
NodeTypeId::ProcessingInstruction => {
let processing_instruction: JSRef<ProcessingInstruction> =
ProcessingInstructionCast::to_ref(self).unwrap();
processing_instruction.Target()
}
NodeTypeId::Comment => "#comment".to_string(),
NodeTypeId::Comment => "#comment".into_string(),
NodeTypeId::DocumentType => {
let doctype: JSRef<DocumentType> = DocumentTypeCast::to_ref(self).unwrap();
doctype.name().clone()
},
NodeTypeId::DocumentFragment => "#document-fragment".to_string(),
NodeTypeId::Document => "#document".to_string()
NodeTypeId::DocumentFragment => "#document-fragment".into_string(),
NodeTypeId::Document => "#document".into_string()
}
}