Use try syntax for Option where appropriate

This commit is contained in:
Matt Brubeck 2017-10-20 08:25:35 -07:00
parent fe16c1d5c3
commit 2d45e9d2da
19 changed files with 65 additions and 180 deletions

View file

@ -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) => {