Skip to content

Commit

Permalink
fmt, lint
Browse files Browse the repository at this point in the history
  • Loading branch information
rmanoka committed Aug 13, 2022
1 parent 0265f40 commit a1bdc10
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
18 changes: 15 additions & 3 deletions geo/src/algorithm/bool_ops/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ pub trait BooleanOps: Sized {
///
/// Returns the set-theoeretic intersection of `self` and `ls` if `invert`
/// is false, and the difference (`ls - self`) otherwise.
fn clip(&self, ls: &MultiLineString<Self::Scalar>, invert: bool) -> MultiLineString<Self::Scalar>;
fn clip(
&self,
ls: &MultiLineString<Self::Scalar>,
invert: bool,
) -> MultiLineString<Self::Scalar>;
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
Expand All @@ -65,7 +69,11 @@ impl<T: GeoFloat> BooleanOps for Polygon<T> {
bop.sweep()
}

fn clip(&self, ls: &MultiLineString<Self::Scalar>, invert: bool) -> MultiLineString<Self::Scalar> {
fn clip(
&self,
ls: &MultiLineString<Self::Scalar>,
invert: bool,
) -> MultiLineString<Self::Scalar> {
let spec = ClipOp::new(invert);
let mut bop = Proc::new(spec, self.coords_count() + ls.coords_count());
bop.add_polygon(self, 0);
Expand All @@ -86,7 +94,11 @@ impl<T: GeoFloat> BooleanOps for MultiPolygon<T> {
bop.sweep()
}

fn clip(&self, ls: &MultiLineString<Self::Scalar>, invert: bool) -> MultiLineString<Self::Scalar> {
fn clip(
&self,
ls: &MultiLineString<Self::Scalar>,
invert: bool,
) -> MultiLineString<Self::Scalar> {
let spec = ClipOp::new(invert);
let mut bop = Proc::new(spec, self.coords_count() + ls.coords_count());
bop.add_multi_polygon(self, 0);
Expand Down
2 changes: 1 addition & 1 deletion geo/src/algorithm/bool_ops/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl<T: GeoFloat> Spec<T> for ClipOp<T> {
}

fn output(&mut self, regions: [Self::Region; 2], geom: LineOrPoint<T>, idx: usize) {
if idx > 0 && (regions[0].is_first && regions[1].is_first) == !self.invert {
if idx > 0 && (regions[0].is_first && regions[1].is_first) != self.invert {
self.assembly.add_edge(geom, idx);
}
}
Expand Down

0 comments on commit a1bdc10

Please sign in to comment.