aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/query.rs
diff options
context:
space:
mode:
authorJohannes Linke <johannes.linke@posteo.de>2016-01-02 16:51:01 +0100
committerJohannes Linke <johannes.linke@posteo.de>2016-01-02 23:27:15 +0100
commit6b215f38eefc98853244c2ec6f4187ae6f000417 (patch)
treecf4dbc65e6b6fa641359b713f91b596bf9f9a666 /components/layout/query.rs
parentb1ca3d1cdff412c5ae12113c3681f789becebabc (diff)
downloadservo-6b215f38eefc98853244c2ec6f4187ae6f000417.tar.gz
servo-6b215f38eefc98853244c2ec6f4187ae6f000417.zip
Fix a bunch of clippy lints
Diffstat (limited to 'components/layout/query.rs')
-rw-r--r--components/layout/query.rs4
1 files changed, 2 insertions, 2 deletions
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<String> {
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,