clippy --fix

This commit is contained in:
Henry Schimke
2023-03-08 14:37:45 -06:00
parent e1332c8010
commit 111baaab81
3 changed files with 6 additions and 7 deletions

View File

@@ -124,9 +124,9 @@ fn test_error_in_parameter_locator(data: &str) {
let r = r.expect("result already tested as ok"); let r = r.expect("result already tested as ok");
assert_eq!(r.getNbLayers(), layers); assert_eq!(r.getNbLayers(), layers);
assert_eq!(r.isCompact(), compact); assert_eq!(r.isCompact(), compact);
let res = decoder::decode(&r).expect(&format!( let res = decoder::decode(&r).unwrap_or_else(|_| {
"decode should be ok: {isMirror}, {error1}, {error2}" panic!("decode should be ok: {isMirror}, {error1}, {error2}")
)); });
assert_eq!(data, res.getText()); assert_eq!(data, res.getText());
} }
} }

View File

@@ -45,9 +45,8 @@ impl GridSampler for DefaultGridSampler {
// To deal with remaining examples (see #251 and #267) of "numercial instabilities" that have not been // To deal with remaining examples (see #251 and #267) of "numercial instabilities" that have not been
// prevented with the Quadrilateral.h:IsConvex() check, we check for all boundary points of the grid to // prevented with the Quadrilateral.h:IsConvex() check, we check for all boundary points of the grid to
// be inside. // be inside.
let isInside = |p: Point| -> bool { let isInside =
return image.is_in(transform.transform_point(p.centered())); |p: Point| -> bool { image.is_in(transform.transform_point(p.centered())) };
};
for y in (p0.y as i32)..(p1.y as i32) { for y in (p0.y as i32)..(p1.y as i32) {
// for (int y = y0; y < y1; ++y) // for (int y = y0; y < y1; ++y)
if !isInside(point(p0.x, y as f32)) || !isInside(point(p1.x - 1.0, y as f32)) { if !isInside(point(p0.x, y as f32)) || !isInside(point(p1.x - 1.0, y as f32)) {

View File

@@ -171,7 +171,7 @@ impl Quadrilateral {
let mirror = if let Some(m) = mirror { m } else { false }; let mirror = if let Some(m) = mirror { m } else { false };
let mut res = self.clone(); let mut res = *self;
res.0.rotate_left(((n + 4) % 4) as usize); res.0.rotate_left(((n + 4) % 4) as usize);
// std::rotate_copy(q.begin(), q.begin() + ((n + 4) % 4), q.end(), res.begin()); // std::rotate_copy(q.begin(), q.begin() + ((n + 4) % 4), q.end(), res.begin());
if mirror { if mirror {