From bc85ddbaabb62c78dffb828f78298fb891d3f1c3 Mon Sep 17 00:00:00 2001 From: Dmitry Zolotukhin Date: Sat, 25 May 2024 19:50:39 +0200 Subject: [PATCH] Addressed Clippy comments. --- src/output.rs | 6 +++--- src/reconstruction.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/output.rs b/src/output.rs index 1d04b69..4aa5bd2 100644 --- a/src/output.rs +++ b/src/output.rs @@ -132,7 +132,7 @@ impl ProjectedPolygon { .clamp(0.0, self.max_y as f64) as usize; ProjectedPolygonIterator { - polygon: &self, + polygon: self, max_x: self.max_x, max_y, x: 0, @@ -220,8 +220,8 @@ impl<'a> ProjectedPolygonIterator<'a> { } fn scanline_value(&self, x: f64) -> Option { - let x_c = (x as f64 - self.start_x) / (self.end_x - self.start_x); - if x_c >= 0.0 && x_c <= 1.0 { + let x_c = (x - self.start_x) / (self.end_x - self.start_x); + if (0.0..=1.0).contains(&x_c) { Some(self.start_value * (1.0 - x_c) + x_c * self.end_value) } else { None diff --git a/src/reconstruction.rs b/src/reconstruction.rs index 9562867..c68cecb 100644 --- a/src/reconstruction.rs +++ b/src/reconstruction.rs @@ -646,7 +646,7 @@ impl ImageReconstruction { fn reconstruct_dense( &mut self, gpu_device: Option, - linked_images: &Vec, + linked_images: &[usize], f_matrices: Vec>>>, ) -> Result<(), triangulation::TriangulationError> { let mut gpu_device = gpu_device;