diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-01-20 07:54:46 -0700 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-01-20 07:54:46 -0700 |
commit | 94ebc7c32d5ce58ada3f9d8ffdb60cc025eb5997 (patch) | |
tree | d4982abff1dae6119889edb12e7cc7623105396b /components/script/dom/htmlelement.rs | |
parent | 89645391bf42edd9977ed1b6f9b430ad786f209e (diff) | |
parent | 01ed338746ae71493984259335197e6b66daec45 (diff) | |
download | servo-94ebc7c32d5ce58ada3f9d8ffdb60cc025eb5997.tar.gz servo-94ebc7c32d5ce58ada3f9d8ffdb60cc025eb5997.zip |
auto merge of #4682 : servo/servo/to_owned, r=jdm
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()); } } } |