diff --git a/src/canvas.rs b/src/canvas.rs index c66075e..cf9ea11 100644 --- a/src/canvas.rs +++ b/src/canvas.rs @@ -1124,7 +1124,6 @@ mod all_functional_patterns_tests { assert!(is_functional(version, version.width(), 0, 9)); assert!(!is_functional(version, version.width(), 1, 9)); } - } //}}} @@ -1978,11 +1977,13 @@ impl Canvas { match self.version { Version::Normal(_) => ALL_PATTERNS_QR.iter(), Version::Micro(_) => ALL_PATTERNS_MICRO_QR.iter(), - }.map(|ptn| { + } + .map(|ptn| { let mut c = self.clone(); c.apply_mask(*ptn); c - }).min_by_key(Self::compute_total_penalty_scores) + }) + .min_by_key(Self::compute_total_penalty_scores) .expect("at least one pattern") } diff --git a/src/optimize.rs b/src/optimize.rs index bceca6a..bf154dc 100644 --- a/src/optimize.rs +++ b/src/optimize.rs @@ -332,9 +332,7 @@ impl> Iterator for Optimizer { /// Computes the total encoded length of all segments. pub fn total_encoded_len(segments: &[Segment], version: Version) -> usize { - segments.iter() - .map(|seg| seg.encoded_len(version)) - .sum() + segments.iter().map(|seg| seg.encoded_len(version)).sum() } #[cfg(test)] @@ -453,7 +451,6 @@ mod optimize_tests { Version::Micro(3), ); } - } #[cfg(feature = "bench")] diff --git a/src/render/image.rs b/src/render/image.rs index 31d6a41..878e8f7 100644 --- a/src/render/image.rs +++ b/src/render/image.rs @@ -20,10 +20,10 @@ macro_rules! impl_pixel_for_image_pixel { }; } -impl_pixel_for_image_pixel!{ Luma: p => [p] } -impl_pixel_for_image_pixel!{ LumaA: p => [p, S::max_value()] } -impl_pixel_for_image_pixel!{ Rgb: p => [p, p, p] } -impl_pixel_for_image_pixel!{ Rgba: p => [p, p, p, S::max_value()] } +impl_pixel_for_image_pixel! { Luma: p => [p] } +impl_pixel_for_image_pixel! { LumaA: p => [p, S::max_value()] } +impl_pixel_for_image_pixel! { Rgb: p => [p, p, p] } +impl_pixel_for_image_pixel! { Rgba: p => [p, p, p, S::max_value()] } impl Canvas for (P, ImageBuffer>) { type Pixel = P; @@ -66,7 +66,8 @@ mod render_tests { ], 3, 1, - ).module_dimensions(1, 1) + ) + .module_dimensions(1, 1) .build(); #[cfg_attr(rustfmt, rustfmt_skip)]