aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_thread/lib.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/layout_thread/lib.rs
parentfe16c1d5c3c9084da0ccb85af599d6ec0f8ab20b (diff)
downloadservo-2d45e9d2da571e70deef137f9022de87cc1126f3.tar.gz
servo-2d45e9d2da571e70deef137f9022de87cc1126f3.zip
Use try syntax for Option where appropriate
Diffstat (limited to 'components/layout_thread/lib.rs')
-rw-r--r--components/layout_thread/lib.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs
index db9507144a0..1c590dd799b 100644
--- a/components/layout_thread/lib.rs
+++ b/components/layout_thread/lib.rs
@@ -895,11 +895,7 @@ impl LayoutThread {
}
fn try_get_layout_root<N: LayoutNode>(&self, node: N) -> Option<FlowRef> {
- let mut data = match node.mutate_layout_data() {
- Some(x) => x,
- None => return None,
- };
- let result = data.flow_construction_result.get();
+ let result = node.mutate_layout_data()?.flow_construction_result.get();
let mut flow = match result {
ConstructionResult::Flow(mut flow, abs_descendants) => {