pub fn filter_lanes(self, lanes: impl Iterator<Item = LaneID>, map: &Map) -> Vec<LaneID> {
        let choices: Vec<LaneID> = lanes.filter(|l| self.can_use(map.get_l(*l), map)).collect();
        if self == PathConstraints::Bike {
            let just_bike_lanes: Vec<LaneID> = choices
                .iter()
                .copied()
                .filter(|l| map.get_l(*l).is_biking())
                .collect();
            if !just_bike_lanes.is_empty() {
                return just_bike_lanes;
            }
        }
        choices
    }
// Strict for bikes. If there are bike lanes, not allowed to use other lanes.
Strict for bikes. If there are bike lanes, not allowed to use other lanes.
Strict for bikes . If there are bike lanes not allowed to use other lanes .
pub fn filter_lanes(self, lanes: impl Iterator<Item = LaneID>, map: &Map) -> Vec<LaneID> {
        let choices: Vec<LaneID> = lanes.filter(|l| self.can_use(map.get_l(*l), map)).collect();
        if self == PathConstraints::Bike {
            let just_bike_lanes: Vec<LaneID> = choices
                .iter()
                .copied()
                .filter(|l| map.get_l(*l).is_biking())
                .collect();
            if !just_bike_lanes.is_empty() {
                return just_bike_lanes;
            }
        }
        choices
    }
pub fn filter_lanes ( self , lanes : impl Iterator < Item = LaneID > , map : & Map ) -> Vec < LaneID > { let choices : Vec < LaneID > = lanes . filter ( | l | self . can_use ( map . get_l ( * l ) , map ) ) . collect ( ) ; if self == PathConstraints :: Bike { let just_bike_lanes : Vec < LaneID > = choices . iter ( ) . copied ( ) . filter ( | l | map . get_l ( * l ) . is_biking ( ) ) . collect ( ) ; if ! just_bike_lanes . is_empty ( ) { return just_bike_lanes ; } } choices }
Strict for bikes.
Strict for bikes .
self
lanes
impl Iterator<Item = LaneID>
map
&Map