diff options
author | Ms2ger <ms2ger@gmail.com> | 2014-12-27 16:48:27 +0100 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2014-12-31 10:34:44 +0100 |
commit | b6117a57aae0fe39e64417ba9b8afdb2f701c9ef (patch) | |
tree | a071f05b702f07a86b6745119467b9e5aca13977 /components/script/dom | |
parent | 37a97f3273c442fa59a3f65e8300a2527b004036 (diff) | |
download | servo-b6117a57aae0fe39e64417ba9b8afdb2f701c9ef.tar.gz servo-b6117a57aae0fe39e64417ba9b8afdb2f701c9ef.zip |
Replace the remaining to_string calls by into_string calls.
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/cssstyledeclaration.rs | 22 | ||||
-rw-r--r-- | components/script/dom/htmlelement.rs | 2 | ||||
-rw-r--r-- | components/script/dom/htmlscriptelement.rs | 2 |
3 files changed, 13 insertions, 13 deletions
diff --git a/components/script/dom/cssstyledeclaration.rs b/components/script/dom/cssstyledeclaration.rs index 8b7228dc375..2e20b85f942 100644 --- a/components/script/dom/cssstyledeclaration.rs +++ b/components/script/dom/cssstyledeclaration.rs @@ -39,10 +39,10 @@ macro_rules! css_properties( ( $([$getter:ident, $setter:ident, $cssprop:expr]),* ) => ( $( fn $getter(self) -> DOMString { - self.GetPropertyValue($cssprop.to_string()) + self.GetPropertyValue($cssprop.into_string()) } fn $setter(self, value: DOMString) { - self.SetPropertyValue($cssprop.to_string(), value).unwrap(); + self.SetPropertyValue($cssprop.into_string(), value).unwrap(); } )* ); @@ -123,7 +123,7 @@ impl<'a> CSSStyleDeclarationMethods for JSRef<'a, CSSStyleDeclaration> { } }); - result.unwrap_or("".to_string()) + result.unwrap_or("".into_string()) } // http://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-getpropertyvalue @@ -145,7 +145,7 @@ impl<'a> CSSStyleDeclarationMethods for JSRef<'a, CSSStyleDeclaration> { // Step 2.2.2 & 2.2.3 match declaration { Some(declaration) => list.push(declaration), - None => return "".to_string(), + None => return "".into_string(), } } @@ -157,7 +157,7 @@ impl<'a> CSSStyleDeclarationMethods for JSRef<'a, CSSStyleDeclaration> { if let Some(ref declaration) = self.get_declaration(&property) { serialize_value(declaration) } else { - "".to_string() + "".into_string() } } @@ -174,15 +174,15 @@ impl<'a> CSSStyleDeclarationMethods for JSRef<'a, CSSStyleDeclaration> { .map(|longhand| self.GetPropertyPriority(longhand.clone())) .all(|priority| priority.as_slice() == "important") { - return "important".to_string(); + return "important".into_string(); } // Step 3 } else if self.get_important_declaration(&property).is_some() { - return "important".to_string(); + return "important".into_string(); } // Step 4 - "".to_string() + "".into_string() } // http://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-setproperty @@ -287,7 +287,7 @@ impl<'a> CSSStyleDeclarationMethods for JSRef<'a, CSSStyleDeclaration> { // http://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-setpropertyvalue fn SetPropertyValue(self, property: DOMString, value: DOMString) -> ErrorResult { - self.SetProperty(property, value, "".to_string()) + self.SetProperty(property, value, "".into_string()) } // http://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-removeproperty @@ -326,12 +326,12 @@ impl<'a> CSSStyleDeclarationMethods for JSRef<'a, CSSStyleDeclaration> { // http://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-cssfloat fn CssFloat(self) -> DOMString { - self.GetPropertyValue("float".to_string()) + self.GetPropertyValue("float".into_string()) } // http://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-cssfloat fn SetCssFloat(self, value: DOMString) -> ErrorResult { - self.SetPropertyValue("float".to_string(), value) + self.SetPropertyValue("float".into_string(), value) } fn IndexedGetter(self, index: u32, found: &mut bool) -> DOMString { diff --git a/components/script/dom/htmlelement.rs b/components/script/dom/htmlelement.rs index 46572ed76e0..27cfc3712a3 100644 --- a/components/script/dom/htmlelement.rs +++ b/components/script/dom/htmlelement.rs @@ -167,7 +167,7 @@ impl<'a> HTMLElementCustomAttributeHelpers for JSRef<'a, HTMLElement> { let element: JSRef<Element> = ElementCast::from_ref(self); element.get_attribute(ns!(""), &Atom::from_slice(to_snake_case(name).as_slice())).map(|attr| { let attr = attr.root(); - attr.value().as_slice().to_string() + attr.value().as_slice().into_string() }) } diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs index 17c9820a344..eb1dfbabbd7 100644 --- a/components/script/dom/htmlscriptelement.rs +++ b/components/script/dom/htmlscriptelement.rs @@ -210,7 +210,7 @@ impl<'a> HTMLScriptElementHelpers for JSRef<'a, HTMLScriptElement> { window.evaluate_script_with_result(source.as_slice(), url.serialize().as_slice()); let event = Event::new(GlobalRef::Window(*window), - "load".to_string(), + "load".into_string(), EventBubbles::DoesNotBubble, EventCancelable::NotCancelable).root(); event.set_trusted(true); |