From 544989e4b23739ff42e9c7c3d96770b26706b100 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Mon, 14 Feb 2022 09:58:43 -0500 Subject: [PATCH] clippy --- src/func_plot.rs | 4 ++-- src/lib.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/func_plot.rs b/src/func_plot.rs index 66e8c17..1f05525 100644 --- a/src/func_plot.rs +++ b/src/func_plot.rs @@ -49,7 +49,7 @@ pub fn draw( root.present()?; let output = chart.into_coord_trans(); - return Ok((output, area)); + Ok((output, area)) } // Creates and does the math for creating all the rectangles under the graph @@ -83,5 +83,5 @@ fn integral_rectangles( .filter(|ele| ele != &(0.0, 0.0, 0.0)) .collect(); let area: f32 = data2.iter().map(|(_, _, y)| y * step).sum(); // sum of all rectangles' areas - return (data2, area); + (data2, area) } diff --git a/src/lib.rs b/src/lib.rs index 446c216..9f9c595 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -44,13 +44,13 @@ impl Chart { .map_err(|err| err.to_string())?; let map_coord = draw_output.0; - return Ok(Chart { - convert: Box::new(move |coord| map_coord(coord).map(|(x, y)| (x.into(), y.into()))), + Ok(Chart { + convert: Box::new(move |coord| map_coord(coord).map(|(x, y)| (x, y))), area: draw_output.1, - }); + }) } - pub fn get_area(&self) -> f32 { return self.area; } + pub fn get_area(&self) -> f32 { self.area } pub fn coord(&self, x: i32, y: i32) -> Option { (self.convert)((x, y)).map(|(x, y)| Point::new(x, y))