From 729b8120e0c5799eba6d331224497c5875704fcb Mon Sep 17 00:00:00 2001 From: Pavel Sergeev Date: Sat, 15 Jul 2017 18:34:40 +0300 Subject: [PATCH] rustify if statements style --- .../properties/longhand/inherited_box.mako.rs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/components/style/properties/longhand/inherited_box.mako.rs b/components/style/properties/longhand/inherited_box.mako.rs index b6830761abf..56a11c0ce13 100644 --- a/components/style/properties/longhand/inherited_box.mako.rs +++ b/components/style/properties/longhand/inherited_box.mako.rs @@ -164,11 +164,19 @@ ${helpers.single_keyword("image-rendering", // match Gecko's behavior when it was correct. rounded_angle = rounded_angle + TWO_PI; } - if rounded_angle < 0.25 * PI { Orientation::Angle0 } - else if rounded_angle < 0.75 * PI { Orientation::Angle90 } - else if rounded_angle < 1.25 * PI { Orientation::Angle180 } - else if rounded_angle < 1.75 * PI { Orientation::Angle270 } - else { Orientation::Angle0 } + if rounded_angle < 0.25 * PI { + return Orientation::Angle0 + } + if rounded_angle < 0.75 * PI { + return Orientation::Angle90 + } + if rounded_angle < 1.25 * PI { + return Orientation::Angle180 + } + if rounded_angle < 1.75 * PI { + return Orientation::Angle270 + } + Orientation::Angle0 } impl ToComputedValue for SpecifiedValue {