mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Replaced DOMString constructor by conversion functions.
Replaced DOMString(...) by DOMString::from(...). Replaced ....0 by String::from(...). Removed any uses of .to_owner() in DOMString::from("...").
This commit is contained in:
parent
736323a779
commit
84bde75b42
64 changed files with 256 additions and 254 deletions
|
@ -84,7 +84,7 @@ macro_rules! make_url_or_base_getter(
|
|||
let url = element.get_url_attribute(&Atom::from_slice($htmlname));
|
||||
if url.is_empty() {
|
||||
let window = window_from_node(self);
|
||||
DOMString(window.get_url().serialize())
|
||||
DOMString::from(window.get_url().serialize())
|
||||
} else {
|
||||
url
|
||||
}
|
||||
|
@ -102,7 +102,6 @@ macro_rules! make_enumerated_getter(
|
|||
use dom::bindings::inheritance::Castable;
|
||||
use dom::element::Element;
|
||||
use std::ascii::AsciiExt;
|
||||
use std::borrow::ToOwned;
|
||||
use string_cache::Atom;
|
||||
let element = self.upcast::<Element>();
|
||||
let mut val = element.get_string_attribute(&Atom::from_slice($htmlname));
|
||||
|
@ -110,7 +109,7 @@ macro_rules! make_enumerated_getter(
|
|||
// https://html.spec.whatwg.org/multipage/#attr-fs-method
|
||||
match &*val {
|
||||
$($choices)|+ => val,
|
||||
_ => DOMString($default.to_owned())
|
||||
_ => DOMString::from($default)
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue