aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlimageelement.rs
diff options
context:
space:
mode:
authorMatt Brubeck <mbrubeck@limpet.net>2017-10-20 08:25:35 -0700
committerMatt Brubeck <mbrubeck@limpet.net>2017-10-20 08:25:35 -0700
commit2d45e9d2da571e70deef137f9022de87cc1126f3 (patch)
treed4f91108a958e80e06110c9437fea132785e8d85 /components/script/dom/htmlimageelement.rs
parentfe16c1d5c3c9084da0ccb85af599d6ec0f8ab20b (diff)
downloadservo-2d45e9d2da571e70deef137f9022de87cc1126f3.tar.gz
servo-2d45e9d2da571e70deef137f9022de87cc1126f3.zip
Use try syntax for Option where appropriate
Diffstat (limited to 'components/script/dom/htmlimageelement.rs')
-rw-r--r--components/script/dom/htmlimageelement.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs
index 498930624c4..39fb44ba224 100644
--- a/components/script/dom/htmlimageelement.rs
+++ b/components/script/dom/htmlimageelement.rs
@@ -661,10 +661,7 @@ impl HTMLImageElement {
}
pub fn areas(&self) -> Option<Vec<DomRoot<HTMLAreaElement>>> {
let elem = self.upcast::<Element>();
- let usemap_attr = match elem.get_attribute(&ns!(), &local_name!("usemap")) {
- Some(attr) => attr,
- None => return None,
- };
+ let usemap_attr = elem.get_attribute(&ns!(), &local_name!("usemap"))?;
let value = usemap_attr.value();