From 6b215f38eefc98853244c2ec6f4187ae6f000417 Mon Sep 17 00:00:00 2001 From: Johannes Linke Date: Sat, 2 Jan 2016 16:51:01 +0100 Subject: Fix a bunch of clippy lints --- components/layout/query.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'components/layout/query.rs') diff --git a/components/layout/query.rs b/components/layout/query.rs index ff084a1adf8..1b1f0907a4b 100644 --- a/components/layout/query.rs +++ b/components/layout/query.rs @@ -480,7 +480,7 @@ pub fn process_resolved_style_request<'ln, N: LayoutNode<'ln>>( requested_node: N, property: &Atom) -> Option { let maybe_data = layout_node.borrow_layout_data(); - let position = maybe_data.map(|data| { + let position = maybe_data.map_or(Point2D::zero(), |data| { match (*data).flow_construction_result { ConstructionResult::Flow(ref flow_ref, _) => flow::base(flow_ref.deref()).stacking_relative_position, @@ -488,7 +488,7 @@ pub fn process_resolved_style_request<'ln, N: LayoutNode<'ln>>( // https://github.com/servo/servo/issues/8307 _ => Point2D::zero() } - }).unwrap_or(Point2D::zero()); + }); let property = match *property { atom!("bottom") => PositionProperty::Bottom, atom!("top") => PositionProperty::Top, -- cgit v1.2.3