mirror of
https://github.com/servo/servo
synced 2026-05-02 04:17:38 +02:00
script_bindings: Eliminate DOMString::from_string (#43089)
This method is the same as `DOMString::from` with a `String` argument and `From` and `Into` are preferred when writing modern Rust. Testing: This should not change behavior and is thus covered by existing tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
@@ -201,11 +201,8 @@ impl<T: HyperlinkElement + DerivedFrom<Element> + Castable + NodeTraits> Hyperli
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-href
|
||||
fn set_href(&self, value: USVString, can_gc: CanGc) {
|
||||
self.upcast::<Element>().set_string_attribute(
|
||||
&local_name!("href"),
|
||||
DOMString::from_string(value.0),
|
||||
can_gc,
|
||||
);
|
||||
self.upcast::<Element>()
|
||||
.set_string_attribute(&local_name!("href"), value.into(), can_gc);
|
||||
|
||||
self.set_url();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user