Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clippy fixes #2614

Merged
merged 9 commits into from Apr 6, 2018

webrender: Don't match on true/false. Use if.

  • Loading branch information
waywardmonkeys committed Apr 5, 2018
commit 638c170db4ffa09cb37dfacdad92fb2b1f4c98f3
@@ -335,14 +335,16 @@ impl ClipSources {
}
}

let outer = match can_calculate_outer_rect {
true => Some(local_outer.unwrap_or_else(LayerRect::zero)),
false => None,
let outer = if can_calculate_outer_rect {
Some(local_outer.unwrap_or_else(LayerRect::zero))
} else {
None
};

let inner = match can_calculate_inner_rect {
true => local_inner.unwrap_or_else(LayerRect::zero),
false => LayerRect::zero(),
let inner = if can_calculate_inner_rect {
local_inner.unwrap_or_else(LayerRect::zero)
} else {
LayerRect::zero()
};

(inner, outer)
@@ -1479,9 +1479,10 @@ impl PrimitiveStore {

// If this primitive is clipped by clips from a different coordinate system, then we
// need to apply a clip mask for the entire primitive.
let mut clip_mask_kind = match has_clips_from_other_coordinate_systems {
true => BrushClipMaskKind::Global,
false => BrushClipMaskKind::Individual,
let mut clip_mask_kind = if has_clips_from_other_coordinate_systems {
BrushClipMaskKind::Global
} else {
BrushClipMaskKind::Individual
};

// Segment the primitive on all the local-space clip sources that we can.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.