pub fn dist_crossed_from_step(&self, map: &Map, step: &PathStep) -> Distance {
        match step {
            PathStep::Lane(l) => {
                let lane = map.get_l(*l);
                if self.orig_req.start.lane() == lane.id {
                    lane.length() - self.orig_req.start.dist_along()
                } else if self.orig_req.end.lane() == lane.id {
                    self.orig_req.end.dist_along()
                } else {
                    lane.length()
                }
            }
            PathStep::ContraflowLane(l) => {
                let lane = map.get_l(*l);
                if self.orig_req.start.lane() == lane.id {
                    self.orig_req.start.dist_along()
                } else if self.orig_req.end.lane() == lane.id {
                    lane.length() - self.orig_req.end.dist_along()
                } else {
                    lane.length()
                }
            }
            PathStep::Turn(t) => map.get_t(*t).geom.length(),
        }
    }
/// Once we finish this PathStep, how much distance will be crossed? If the step is at the
/// beginning or end of our path, then the full length may not be used.
Once we finish this PathStep, how much distance will be crossed. If the step is at the
beginning or end of our path, then the full length may not be used.
Once we finish this PathStep how much distance will be crossed . If the step is at the beginning or end of our path then the full length may not be used .
pub fn dist_crossed_from_step(&self, map: &Map, step: &PathStep) -> Distance {
        match step {
            PathStep::Lane(l) => {
                let lane = map.get_l(*l);
                if self.orig_req.start.lane() == lane.id {
                    lane.length() - self.orig_req.start.dist_along()
                } else if self.orig_req.end.lane() == lane.id {
                    self.orig_req.end.dist_along()
                } else {
                    lane.length()
                }
            }
            PathStep::ContraflowLane(l) => {
                let lane = map.get_l(*l);
                if self.orig_req.start.lane() == lane.id {
                    self.orig_req.start.dist_along()
                } else if self.orig_req.end.lane() == lane.id {
                    lane.length() - self.orig_req.end.dist_along()
                } else {
                    lane.length()
                }
            }
            PathStep::Turn(t) => map.get_t(*t).geom.length(),
        }
    }
pub fn dist_crossed_from_step ( & self , map : & Map , step : & PathStep ) -> Distance { match step { PathStep :: Lane ( l ) => { let lane = map . get_l ( * l ) ; if self . orig_req . start . lane ( ) == lane . id { lane . length ( ) - self . orig_req . start . dist_along ( ) } else if self . orig_req . end . lane ( ) == lane . id { self . orig_req . end . dist_along ( ) } else { lane . length ( ) } } PathStep :: ContraflowLane ( l ) => { let lane = map . get_l ( * l ) ; if self . orig_req . start . lane ( ) == lane . id { self . orig_req . start . dist_along ( ) } else if self . orig_req . end . lane ( ) == lane . id { lane . length ( ) - self . orig_req . end . dist_along ( ) } else { lane . length ( ) } } PathStep :: Turn ( t ) => map . get_t ( * t ) . geom . length ( ) , } }
Once we finish this PathStep, how much distance will be crossed?
Once we finish this PathStep how much distance will be crossed?
&self
map
&Map
step
&PathStep