mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Move to to_owned rather than into_string.
into_string has been removed from Rust.
This commit is contained in:
parent
2d5b0e0855
commit
01ed338746
67 changed files with 473 additions and 383 deletions
|
@ -106,13 +106,14 @@ macro_rules! make_enumerated_getter(
|
|||
use dom::bindings::codegen::InheritTypes::ElementCast;
|
||||
#[allow(unused_imports)]
|
||||
use std::ascii::AsciiExt;
|
||||
use std::borrow::ToOwned;
|
||||
let element: JSRef<Element> = ElementCast::from_ref(self);
|
||||
let val = element.get_string_attribute(&Atom::from_slice($htmlname))
|
||||
.into_ascii_lower();
|
||||
// https://html.spec.whatwg.org/multipage/forms.html#attr-fs-method
|
||||
match val.as_slice() {
|
||||
$($choices)|+ => val,
|
||||
_ => $default.into_string()
|
||||
_ => $default.to_owned()
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue