diff options
author | Ms2ger <ms2ger@gmail.com> | 2015-01-20 14:45:36 +0100 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2015-01-20 14:49:07 +0100 |
commit | 01ed338746ae71493984259335197e6b66daec45 (patch) | |
tree | b568699de2c64d6f4eb21b197fd648c354d0ed37 /components/script/dom/htmlelement.rs | |
parent | 2d5b0e085571594e7da2ee519605dd6fac2caa54 (diff) | |
download | servo-01ed338746ae71493984259335197e6b66daec45.tar.gz servo-01ed338746ae71493984259335197e6b66daec45.zip |
Move to to_owned rather than into_string.
into_string has been removed from Rust.
Diffstat (limited to 'components/script/dom/htmlelement.rs')
-rw-r--r-- | components/script/dom/htmlelement.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/components/script/dom/htmlelement.rs b/components/script/dom/htmlelement.rs index d60591bb390..d5fae8353be 100644 --- a/components/script/dom/htmlelement.rs +++ b/components/script/dom/htmlelement.rs @@ -30,6 +30,7 @@ use servo_util::str::DOMString; use string_cache::Atom; +use std::borrow::ToOwned; use std::default::Default; #[dom_struct] @@ -141,7 +142,7 @@ pub trait HTMLElementCustomAttributeHelpers { } fn to_snake_case(name: DOMString) -> DOMString { - let mut attr_name = "data-".into_string(); + let mut attr_name = "data-".to_owned(); for ch in name.as_slice().chars() { if ch.is_uppercase() { attr_name.push('\x2d'); @@ -168,7 +169,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.r().value().as_slice().into_string() + attr.r().value().as_slice().to_owned() }) } @@ -199,7 +200,7 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLElement> { let evtarget: JSRef<EventTarget> = EventTargetCast::from_ref(*self); evtarget.set_event_handler_uncompiled(cx, url, reflector, name.slice_from(2), - attr.value().as_slice().into_string()); + attr.value().as_slice().to_owned()); } } } |