fix(RouteStepper): borrowing mixup

This commit is contained in:
Ellen Emilia Anna Zscheile 2025-02-15 13:46:16 +01:00
parent a7c8474153
commit a39546f0c9
1 changed files with 5 additions and 6 deletions

View File

@ -84,8 +84,11 @@ impl<'a, R: AccessRules> Step<Router<'a, R>, BandTermsegIndex> for RouteStepper
let layout = router.layout_mut(); let layout = router.layout_mut();
let target = self.astar.graph.destination(); let target = self.astar.graph.destination();
let mut strategy = RouterAstarStrategy::new(layout, &mut self.navcord, target); let mut strategy = RouterAstarStrategy::new(layout, &mut self.navcord, target);
let result = self.astar.step(&mut strategy);
self.ghosts = strategy.probe_ghosts;
self.obstacles = strategy.probe_obstacles;
let result = match self.astar.step(&mut strategy) { match result {
Ok(ControlFlow::Continue(..)) => Ok(ControlFlow::Continue(())), Ok(ControlFlow::Continue(..)) => Ok(ControlFlow::Continue(())),
Ok(ControlFlow::Break((_cost, _path, band))) => Ok(ControlFlow::Break(band)), Ok(ControlFlow::Break((_cost, _path, band))) => Ok(ControlFlow::Break(band)),
Err(e) => { Err(e) => {
@ -96,10 +99,6 @@ impl<'a, R: AccessRules> Step<Router<'a, R>, BandTermsegIndex> for RouteStepper
} }
Err(e) Err(e)
} }
}; }
self.ghosts = strategy.probe_ghosts;
self.obstacles = strategy.probe_obstacles;
result
} }
} }