Skip to content

Commit 8f39a5e

Browse files
committed
remove unnecessary if statement
1 parent fbfefd6 commit 8f39a5e

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

plotters/src/element/pie.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,7 @@ impl<'a, DB: DrawingBackend, Label: Display> Drawable<DB> for Pie<'a, (i32, i32)
189189
let label_size = backend.estimate_text_size(&perc_label, percentage_style)?;
190190
let text_x_mid = (label_size.0 as f64 / 2.0).round() as i32;
191191
let text_y_mid = (label_size.1 as f64 / 2.0).round() as i32;
192-
let perc_radius = if self.donut_hole == 0.0 {
193-
self.radius / 2.0
194-
} else {
195-
(self.radius + self.donut_hole) / 2.0
196-
};
192+
let perc_radius = (self.radius + self.donut_hole) / 2.0;
197193
let perc_coord = theta_to_ordinal_coord(
198194
perc_radius,
199195
middle_theta,

0 commit comments

Comments
 (0)