Skip to content

Commit 77123f9

Browse files
committed
format
1 parent 7f055ec commit 77123f9

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

backend/src/geo_helpers/mod.rs

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
mod slice_nearest_boundary;
22
pub use slice_nearest_boundary::SliceNearestFrechetBoundary;
33

4-
use geo::{BooleanOps, BoundingRect, Contains, Coord, Distance, Euclidean, Intersects, Length, Line, LineInterpolatePoint, LineIntersection, LineLocatePoint, LineString, Point, Polygon, Rect, Validation};
4+
use geo::{
5+
BooleanOps, BoundingRect, Contains, Coord, Distance, Euclidean, Intersects, Length, Line,
6+
LineInterpolatePoint, LineIntersection, LineLocatePoint, LineString, Point, Polygon, Rect,
7+
Validation,
8+
};
59
use rstar::AABB;
610
use utils::LineSplit;
711

@@ -139,11 +143,14 @@ pub fn make_polygon_valid(polygon: &Polygon) -> Polygon {
139143
let mut valid_multipolygon = polygon.union(polygon);
140144

141145
// I don't think we should get more than one piece back for any sane input, but we'll see...
142-
debug_assert!(valid_multipolygon.0.len() == 1, "MultiPolygon not handle yet");
146+
debug_assert!(
147+
valid_multipolygon.0.len() == 1,
148+
"MultiPolygon not handle yet"
149+
);
143150

144151
let Some(valid_polygon) = valid_multipolygon.0.pop() else {
145152
debug_assert!(false, "empty valid polygon not handled yet");
146-
return polygon.clone()
153+
return polygon.clone();
147154
};
148155

149156
debug_assert!(valid_polygon.is_valid());

backend/src/geo_helpers/slice_nearest_boundary.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ impl SliceNearestFrechetBoundary for Polygon {
103103
}
104104
}
105105

106-
let assemble = |starting_segment_idx: usize, ending_segment_idx: usize, starting_coord, ending_coord| {
106+
let assemble = |starting_segment_idx: usize,
107+
ending_segment_idx: usize,
108+
starting_coord,
109+
ending_coord| {
107110
let mut coords = match starting_segment_idx.cmp(&ending_segment_idx) {
108111
Ordering::Less => {
109112
let mut coords = exterior.0[starting_segment_idx..=ending_segment_idx].to_vec();

backend/src/neighbourhood.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ use std::collections::BTreeSet;
22

33
use crate::geo_helpers::{make_polygon_valid, SliceNearestFrechetBoundary};
44
use anyhow::Result;
5-
use geo::{
6-
Area, Distance, Euclidean, Length, Line, LineString, Polygon, PreparedGeometry,
7-
Relate,
8-
};
5+
use geo::{Area, Distance, Euclidean, Length, Line, LineString, Polygon, PreparedGeometry, Relate};
96
use geojson::{Feature, FeatureCollection, Geometry};
107
use web_time::Instant;
118

web/src/App.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
</script>
9191

9292
<div class="pico">
93-
<About class="pico" />
93+
<About class="pico" />
9494
</div>
9595
<Layout>
9696
<div slot="top" class="pico" style="display: flex">

0 commit comments

Comments
 (0)