diff --git a/geom/src/polygon.rs b/geom/src/polygon.rs index fee1f5cd03..ee14c76f88 100644 --- a/geom/src/polygon.rs +++ b/geom/src/polygon.rs @@ -4,7 +4,6 @@ use std::fmt; use geo::algorithm::area::Area; use geo::algorithm::convex_hull::ConvexHull; use geo_booleanop::boolean::BooleanOp; -use geo::algorithm::intersects::Intersects; use serde::{Deserialize, Serialize}; use crate::{Angle, Bounds, Distance, HashablePt2D, PolyLine, Pt2D, Ring}; @@ -302,8 +301,7 @@ impl Polygon { } pub fn polylabel(&self) -> Pt2D { - let polygon: geo::Polygon<_> = to_geo(&self.points()); - let pt = polylabel::polylabel(&polygon, &1.0).unwrap(); + let pt = polylabel::polylabel(&to_geo(&self.points()), &1.0).unwrap(); Pt2D::new(pt.x(), pt.y()) } @@ -315,7 +313,9 @@ impl Polygon { Ok(Polygon::union_all( rings.iter().map(|r| r.to_outline(thickness)).collect(), )) - } else { Ring::new(self.points.clone()).map(|r| r.to_outline(thickness)) } + } else { + Ring::new(self.points.clone()).map(|r| r.to_outline(thickness)) + } } /// Remove the internal rings used for to_outline. This is fine to do if the polygon is being