Skip to content

Commit 4153ad5

Browse files
committed
chore: allow get_edges method for any trace
1 parent 3d43d67 commit 4153ad5

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/trace.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,6 @@ impl Trace {
6363
}
6464
}
6565

66-
pub fn get_edges(&self) -> (&PointWithId, &PointWithId) {
67-
let start_point = self.points.first().unwrap();
68-
let end_point = self.points.last().unwrap();
69-
70-
(start_point, end_point)
71-
}
72-
7366
pub fn common_trace_with(&self, other: &Trace) -> Result<CommonTrace> {
7467
let mut all_points: Vec<&PointWithId> =
7568
self.points.iter().chain(other.points.iter()).collect();
@@ -301,6 +294,12 @@ impl<T> Trace<T> {
301294
pub fn haversine_length(&self) -> f64 {
302295
LineString::from(self).haversine_length()
303296
}
297+
pub fn get_edges(&self) -> (&PointWithId, &PointWithId) {
298+
let start_point = self.points.first().unwrap();
299+
let end_point = self.points.last().unwrap();
300+
301+
(start_point, end_point)
302+
}
304303
}
305304

306305
impl From<Trace<Simplified>> for TraceOutput {

0 commit comments

Comments
 (0)