Merge pull request #32 from Atul9/cargo-fmt
Format code using 'cargo fmt'
This commit is contained in:
commit
6323585a35
|
@ -1124,7 +1124,6 @@ mod all_functional_patterns_tests {
|
||||||
assert!(is_functional(version, version.width(), 0, 9));
|
assert!(is_functional(version, version.width(), 0, 9));
|
||||||
assert!(!is_functional(version, version.width(), 1, 9));
|
assert!(!is_functional(version, version.width(), 1, 9));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//}}}
|
//}}}
|
||||||
|
@ -1978,11 +1977,13 @@ impl Canvas {
|
||||||
match self.version {
|
match self.version {
|
||||||
Version::Normal(_) => ALL_PATTERNS_QR.iter(),
|
Version::Normal(_) => ALL_PATTERNS_QR.iter(),
|
||||||
Version::Micro(_) => ALL_PATTERNS_MICRO_QR.iter(),
|
Version::Micro(_) => ALL_PATTERNS_MICRO_QR.iter(),
|
||||||
}.map(|ptn| {
|
}
|
||||||
|
.map(|ptn| {
|
||||||
let mut c = self.clone();
|
let mut c = self.clone();
|
||||||
c.apply_mask(*ptn);
|
c.apply_mask(*ptn);
|
||||||
c
|
c
|
||||||
}).min_by_key(Self::compute_total_penalty_scores)
|
})
|
||||||
|
.min_by_key(Self::compute_total_penalty_scores)
|
||||||
.expect("at least one pattern")
|
.expect("at least one pattern")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -332,9 +332,7 @@ impl<I: Iterator<Item = Segment>> Iterator for Optimizer<I> {
|
||||||
|
|
||||||
/// Computes the total encoded length of all segments.
|
/// Computes the total encoded length of all segments.
|
||||||
pub fn total_encoded_len(segments: &[Segment], version: Version) -> usize {
|
pub fn total_encoded_len(segments: &[Segment], version: Version) -> usize {
|
||||||
segments.iter()
|
segments.iter().map(|seg| seg.encoded_len(version)).sum()
|
||||||
.map(|seg| seg.encoded_len(version))
|
|
||||||
.sum()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
@ -453,7 +451,6 @@ mod optimize_tests {
|
||||||
Version::Micro(3),
|
Version::Micro(3),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "bench")]
|
#[cfg(feature = "bench")]
|
||||||
|
|
|
@ -20,10 +20,10 @@ macro_rules! impl_pixel_for_image_pixel {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
impl_pixel_for_image_pixel!{ Luma<S>: p => [p] }
|
impl_pixel_for_image_pixel! { Luma<S>: p => [p] }
|
||||||
impl_pixel_for_image_pixel!{ LumaA<S>: p => [p, S::max_value()] }
|
impl_pixel_for_image_pixel! { LumaA<S>: p => [p, S::max_value()] }
|
||||||
impl_pixel_for_image_pixel!{ Rgb<S>: p => [p, p, p] }
|
impl_pixel_for_image_pixel! { Rgb<S>: p => [p, p, p] }
|
||||||
impl_pixel_for_image_pixel!{ Rgba<S>: p => [p, p, p, S::max_value()] }
|
impl_pixel_for_image_pixel! { Rgba<S>: p => [p, p, p, S::max_value()] }
|
||||||
|
|
||||||
impl<P: ImagePixel + 'static> Canvas for (P, ImageBuffer<P, Vec<P::Subpixel>>) {
|
impl<P: ImagePixel + 'static> Canvas for (P, ImageBuffer<P, Vec<P::Subpixel>>) {
|
||||||
type Pixel = P;
|
type Pixel = P;
|
||||||
|
@ -66,7 +66,8 @@ mod render_tests {
|
||||||
],
|
],
|
||||||
3,
|
3,
|
||||||
1,
|
1,
|
||||||
).module_dimensions(1, 1)
|
)
|
||||||
|
.module_dimensions(1, 1)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
#[cfg_attr(rustfmt, rustfmt_skip)]
|
||||||
|
|
Loading…
Reference in a new issue