Skip to content

Commit

Permalink
Clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRega committed May 6, 2022
1 parent 4b16e93 commit 305e400
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ssim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ pub fn ssim_simple(first: &GrayImage, second: &GrayImage) -> Result<GraySimilari
let windows = window.subdivide_by_offset(DEFAULT_WINDOW_SIZE);
let results = windows
.par_iter()
.map(|w| (ssim_for_window(first, second, &w), w))
.map(|w| (ssim_for_window(first, second, w), w))
.collect::<Vec<_>>();
let score = results.iter().map(|r| r.0 * r.1.area() as f64).sum::<f64>()
/ results.iter().map(|r| r.1.area() as f64).sum::<f64>();

results
.iter()
.for_each(|r| draw_window_to_image(&r.1, &mut image, r.0 as f32));
.for_each(|r| draw_window_to_image(r.1, &mut image, r.0 as f32));

Ok(GraySimilarity { image, score })
}
Expand Down

0 comments on commit 305e400

Please sign in to comment.