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:
bors-servo 2016-01-06 08:02:33 +05:30
commit 25c2b7dec6

View file

@ -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