@@ -107,7 +107,7 @@ pub type CourseSetBuilder = CourseSetBuilderImpl<GeoPoint>;
107107
108108pub struct CourseSetBuilderImpl < P >
109109where
110- P : HasGeoPoint + Send + Sync ,
110+ P : HasGeoPoint + TryFrom < GeoPoint > + Send + Sync ,
111111 <P as TryFrom < GeoPoint > >:: Error : Send ,
112112 CourseError : From < <P as TryFrom < GeoPoint > >:: Error > ,
113113{
@@ -120,7 +120,7 @@ where
120120impl < P > CourseSetBuilderImpl < P >
121121where
122122 Self : SolveIntercept < P > ,
123- P : HasGeoPoint + Send + Sync ,
123+ P : HasGeoPoint + TryFrom < GeoPoint > + Send + Sync ,
124124 <P as TryFrom < GeoPoint > >:: Error : Send ,
125125 CourseError : From < <P as TryFrom < GeoPoint > >:: Error > ,
126126{
@@ -296,7 +296,7 @@ where
296296
297297pub trait SolveIntercept < P >
298298where
299- P : HasGeoPoint + Send + Sync ,
299+ P : HasGeoPoint + TryFrom < GeoPoint > + Send + Sync ,
300300 CourseError : From < <P as TryFrom < GeoPoint > >:: Error > ,
301301{
302302 fn solve_intercept (
@@ -471,7 +471,8 @@ impl CourseBuilder {
471471 /// parameter `P` (such as [`XyzPoint`]).
472472 fn segment < P > ( self ) -> Result < SegmentedCourseBuilder < P > >
473473 where
474- P : HasGeoPoint + Send + Sync ,
474+ P : HasGeoPoint + TryFrom < GeoPoint > + Send + Sync ,
475+ GeoSegment < P > : FromGeoPoints < P > ,
475476 <P as TryFrom < GeoPoint > >:: Error : Send ,
476477 CourseError : From < <P as TryFrom < GeoPoint > >:: Error > ,
477478 {
@@ -496,7 +497,7 @@ impl CourseBuilder {
496497 . collect :: < Vec < _ > > ( ) ;
497498
498499 Ok ( SegmentedCourseBuilder {
499- route_points : self . route_points ,
500+ route_points : ps ,
500501 segments_and_distances,
501502 name : self . name ,
502503 course_points : Vec :: new ( ) ,
@@ -515,11 +516,12 @@ impl CourseBuilder {
515516/// course points.
516517struct SegmentedCourseBuilder < P >
517518where
518- P : HasGeoPoint + Send + Sync ,
519+ P : HasGeoPoint + TryFrom < GeoPoint > + Send + Sync ,
520+ GeoSegment < P > : FromGeoPoints < P > ,
519521 <P as TryFrom < GeoPoint > >:: Error : Send ,
520522 CourseError : From < <P as TryFrom < GeoPoint > >:: Error > ,
521523{
522- route_points : Vec < GeoPoint > ,
524+ route_points : Vec < P > ,
523525 segments_and_distances : Vec < ( GeoSegment < P > , Meter < f64 > ) > ,
524526 name : Option < String > ,
525527 course_points : Vec < CoursePoint > ,
@@ -528,7 +530,8 @@ where
528530
529531impl < P > SegmentedCourseBuilder < P >
530532where
531- P : HasGeoPoint + Send + Sync ,
533+ P : HasGeoPoint + TryFrom < GeoPoint > + Send + Sync ,
534+ GeoSegment < P > : FromGeoPoints < P > ,
532535 <P as TryFrom < GeoPoint > >:: Error : Send ,
533536 CourseError : From < <P as TryFrom < GeoPoint > >:: Error > ,
534537{
@@ -551,7 +554,7 @@ where
551554 }
552555 if let Some ( rp) = self . route_points . last ( ) {
553556 records. push ( Record {
554- point : * rp,
557+ point : * rp. geo ( ) ,
555558 cumulative_distance : total_distance,
556559 } )
557560 }
@@ -598,7 +601,7 @@ pub struct Record {
598601/// along the course and lacks a known course distance.
599602pub struct Waypoint < P >
600603where
601- P : HasGeoPoint + Send + Sync ,
604+ P : HasGeoPoint + TryFrom < GeoPoint > + Send + Sync ,
602605 CourseError : From < <P as TryFrom < GeoPoint > >:: Error > ,
603606{
604607 /// Position of the waypoint.
0 commit comments