@@ -45,7 +45,6 @@ enum PathfindingViewErrors {
45
45
struct PathfindingTrackLocationDirInput {
46
46
track : Identifier ,
47
47
position : f64 ,
48
- direction : Direction ,
49
48
}
50
49
51
50
#[ derive( Debug , Clone , Deserialize ) ]
@@ -128,11 +127,11 @@ struct PathfindingStep {
128
127
}
129
128
130
129
impl PathfindingStep {
131
- fn new_init ( track : String , position : f64 , direction : Direction ) -> Self {
130
+ fn new_init ( track : String , position : f64 ) -> Self {
132
131
Self {
133
132
track,
134
133
position,
135
- direction,
134
+ direction : Direction :: StartToStop , // Ignored for initial node
136
135
switch_direction : None ,
137
136
found : false ,
138
137
starting_step : true ,
@@ -185,7 +184,7 @@ fn compute_path(
185
184
k : u8 ,
186
185
) -> Vec < PathfindingOutput > {
187
186
let start = & input. starting ;
188
- let start = PathfindingStep :: new_init ( start. track . 0 . clone ( ) , start. position , start . direction ) ;
187
+ let start = PathfindingStep :: new_init ( start. track . 0 . clone ( ) , start. position ) ;
189
188
190
189
let track_sections = infra_cache. track_sections ( ) ;
191
190
// Transform a length (in m) into a cost (in mm). This provide the Ord implementation for our cost using u64.
@@ -403,7 +402,6 @@ mod tests {
403
402
starting : PathfindingTrackLocationDirInput {
404
403
track : "A" . into ( ) ,
405
404
position : 30.0 ,
406
- direction : Direction :: StartToStop ,
407
405
} ,
408
406
ending : PathfindingTrackLocationInput {
409
407
track : "C" . into ( ) ,
@@ -427,7 +425,6 @@ mod tests {
427
425
starting : PathfindingTrackLocationDirInput {
428
426
track : "A" . into ( ) ,
429
427
position : 30.0 ,
430
- direction : Direction :: StopToStart ,
431
428
} ,
432
429
ending : PathfindingTrackLocationInput {
433
430
track : "C" . into ( ) ,
0 commit comments