Fix a bunch of clippy lints

This commit is contained in:
Johannes Linke 2016-01-02 16:51:01 +01:00
parent b1ca3d1cdf
commit 6b215f38ee
58 changed files with 281 additions and 356 deletions

View file

@ -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,