mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #9161 - frewsxcv:cleanup-match, r=jdm
Reduce 'match' body, remove unnecessary clone <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9161) <!-- Reviewable:end -->
This commit is contained in:
commit
25c2b7dec6
1 changed files with 3 additions and 10 deletions
|
@ -48,16 +48,9 @@ impl DOMStringMapMethods for DOMStringMap {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-domstringmap-nameditem
|
||||
fn NamedGetter(&self, name: DOMString, found: &mut bool) -> DOMString {
|
||||
match self.element.get_custom_attr(name) {
|
||||
Some(value) => {
|
||||
*found = true;
|
||||
value.clone()
|
||||
},
|
||||
None => {
|
||||
*found = false;
|
||||
DOMString::new()
|
||||
}
|
||||
}
|
||||
let attr = self.element.get_custom_attr(name);
|
||||
*found = attr.is_some();
|
||||
attr.unwrap_or_default()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#the-domstringmap-interface:supported-property-names
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue