mirror of
https://github.com/servo/servo
synced 2026-04-26 01:25:32 +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:
@@ -84,10 +84,11 @@ impl SpecificCSSRule for CSSLayerBlockRule {
|
||||
impl CSSLayerBlockRuleMethods<crate::DomTypeHolder> for CSSLayerBlockRule {
|
||||
/// <https://drafts.csswg.org/css-cascade-5/#dom-csslayerblockrule-name>
|
||||
fn Name(&self) -> DOMString {
|
||||
if let Some(name) = &self.layer_block_rule.borrow().name {
|
||||
DOMString::from_string(name.to_css_string())
|
||||
} else {
|
||||
DOMString::new()
|
||||
}
|
||||
self.layer_block_rule
|
||||
.borrow()
|
||||
.name
|
||||
.as_ref()
|
||||
.map(|name| name.to_css_cssstring().into())
|
||||
.unwrap_or_default()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user