diff options
Diffstat (limited to 'components/script/dom/htmlformelement.rs')
-rw-r--r-- | components/script/dom/htmlformelement.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs index 50c58a22cad..4ad04302e1d 100644 --- a/components/script/dom/htmlformelement.rs +++ b/components/script/dom/htmlformelement.rs @@ -157,7 +157,7 @@ impl<'a> HTMLFormElementHelpers for JSRef<'a, HTMLFormElement> { // TODO: Handle browsing contexts // TODO: Handle validation let event = Event::new(GlobalRef::Window(*win), - "submit".to_string(), + "submit".into_string(), EventBubbles::Bubbles, EventCancelable::Cancelable).root(); event.set_trusted(true); @@ -185,7 +185,7 @@ impl<'a> HTMLFormElementHelpers for JSRef<'a, HTMLFormElement> { let parsed_data = match enctype { FormEncType::UrlEncoded => serialize(form_data.iter().map(|d| (d.name.as_slice(), d.value.as_slice()))), - _ => "".to_string() // TODO: Add serializers for the other encoding types + _ => "".into_string() // TODO: Add serializers for the other encoding types }; let mut load_data = LoadData::new(action_components); @@ -213,7 +213,7 @@ impl<'a> HTMLFormElementHelpers for JSRef<'a, HTMLFormElement> { fn clean_crlf(s: &str) -> DOMString { // https://html.spec.whatwg.org/multipage/forms.html#constructing-the-form-data-set // Step 4 - let mut buf = "".to_string(); + let mut buf = "".into_string(); let mut prev = ' '; for ch in s.chars() { match ch { @@ -283,7 +283,7 @@ impl<'a> HTMLFormElementHelpers for JSRef<'a, HTMLFormElement> { "image" => None, // Unimplemented "radio" | "checkbox" => { if value.is_empty() { - value = "on".to_string(); + value = "on".into_string(); } Some(FormDatum { ty: ty, @@ -345,7 +345,7 @@ impl<'a> HTMLFormElementHelpers for JSRef<'a, HTMLFormElement> { let win = window_from_node(self).root(); let event = Event::new(GlobalRef::Window(*win), - "reset".to_string(), + "reset".into_string(), EventBubbles::Bubbles, EventCancelable::Cancelable).root(); let target: JSRef<EventTarget> = EventTargetCast::from_ref(self); @@ -515,7 +515,7 @@ pub trait FormControl<'a> : Copy { if self.to_element().has_attribute(attr) { input(self) } else { - self.form_owner().map_or("".to_string(), |t| owner(*t.root())) + self.form_owner().map_or("".into_string(), |t| owner(*t.root())) } } fn to_element(self) -> JSRef<'a, Element>; |