Skip to content

Commit 6d87c97

Browse files
committed
address clippy casting in offset
1 parent 6018dd4 commit 6d87c97

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/sketch/offset.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,26 +76,31 @@ macro_rules! cast_through_f64 {
7676
}};
7777
}
7878

79+
#[allow(clippy::unnecessary_cast)]
7980
fn buf_poly(poly: &Polygon<Real>, d: Real) -> MultiPolygon<Real> {
8081
cast_through_f64!(poly, |p: &Polygon<f64>| buffer_polygon(p, d as f64))
8182
}
8283

84+
#[allow(clippy::unnecessary_cast)]
8385
fn buf_poly_round(poly: &Polygon<Real>, d: Real) -> MultiPolygon<Real> {
8486
cast_through_f64!(poly, |p: &Polygon<f64>| buffer_polygon_rounded(p, d as f64))
8587
}
8688

89+
#[allow(clippy::unnecessary_cast)]
8790
fn buf_multi_poly(mpoly: &MultiPolygon<Real>, d: Real) -> MultiPolygon<Real> {
8891
cast_through_f64!(mpoly, |m: &MultiPolygon<f64>| buffer_multi_polygon(
8992
m, d as f64
9093
))
9194
}
9295

96+
#[allow(clippy::unnecessary_cast)]
9397
fn buf_multi_poly_round(mpoly: &MultiPolygon<Real>, d: Real) -> MultiPolygon<Real> {
9498
cast_through_f64!(mpoly, |m: &MultiPolygon<f64>| buffer_multi_polygon_rounded(
9599
m, d as f64
96100
))
97101
}
98102

103+
#[allow(clippy::unnecessary_cast)]
99104
fn buf_point(pt: &Point<Real>, d: Real, res: usize) -> Polygon<Real> {
100105
// buffer_point takes f64 Point, so just build one and cast result back
101106
let pt_f64 = Point::new(pt.x() as f64, pt.y() as f64);
@@ -105,6 +110,7 @@ fn buf_point(pt: &Point<Real>, d: Real, res: usize) -> Polygon<Real> {
105110
})
106111
}
107112

113+
#[allow(clippy::unnecessary_cast)]
108114
fn skel_poly(poly: &Polygon<Real>, inward: bool) -> Vec<LineString<Real>> {
109115
let poly_f64 = poly.map_coords(|c| Coord {
110116
x: c.x as f64,
@@ -121,6 +127,7 @@ fn skel_poly(poly: &Polygon<Real>, inward: bool) -> Vec<LineString<Real>> {
121127
.collect()
122128
}
123129

130+
#[allow(clippy::unnecessary_cast)]
124131
fn skel_multi_poly(mpoly: &MultiPolygon<Real>, inward: bool) -> Vec<LineString<Real>> {
125132
let mpoly_f64 = mpoly.map_coords(|c| Coord {
126133
x: c.x as f64,

0 commit comments

Comments
 (0)