Undo rust-fmt changes
@@ -8,7 +8,7 @@ pub enum DistanceAlg {
PythagorasSquared,
Manhattan,
Chebyshev,
- Diagonal,
+ Diagonal
}
impl DistanceAlg {
@@ -19,7 +19,7 @@ impl DistanceAlg {
DistanceAlg::PythagorasSquared => distance2d_pythagoras_squared(start, end),
DistanceAlg::Manhattan => distance2d_manhattan(start, end),
DistanceAlg::Chebyshev => distance2d_chebyshev(start, end),
- DistanceAlg::Diagonal => distance2d_diagonal(start, end),
+ DistanceAlg::Diagonal => distance2d_diagonal(start, end)
}
}
/// Provides a 3D distance between points, using the specified algorithm.
@@ -29,7 +29,7 @@ impl DistanceAlg {
DistanceAlg::PythagorasSquared => distance3d_pythagoras_squared(start, end),
DistanceAlg::Manhattan => distance3d_manhattan(start, end),
DistanceAlg::Chebyshev => distance3d_pythagoras(start, end),
- DistanceAlg::Diagonal => distance3d_diagonal(start, end),
+ DistanceAlg::Diagonal => distance3d_diagonal(start, end)
}
}
}
@@ -96,7 +96,10 @@ fn distance2d_diagonal(start: Point, end: Point) -> f32 {
fn distance3d_diagonal(start: Point3, end: Point3) -> f32 {
i32::max(
(start.x - end.x).abs(),
- i32::max((start.y - end.y).abs(), (start.z - end.z).abs()),
+ i32::max(
+ (start.y - end.y).abs(),
+ (start.z - end.z).abs()
+ )
) as f32
}
