mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-29 12:43:38 +03:00
upgrade to rust 1.42 for better unwrap() errors and use of matches!
This commit is contained in:
parent
6e8846bf85
commit
78407dd529
@ -5,7 +5,7 @@
|
||||
You will first need:
|
||||
|
||||
- Standard dependencies: `bash`, `curl`, `unzip`, `gunzip`
|
||||
- Rust, at least 1.41. https://www.rust-lang.org/tools/install
|
||||
- Rust, at least 1.42. https://www.rust-lang.org/tools/install
|
||||
|
||||
One-time setup:
|
||||
|
||||
|
@ -1007,10 +1007,7 @@ impl DrivingSimState {
|
||||
if intersections
|
||||
.get_accepted_agents(i)
|
||||
.iter()
|
||||
.any(|a| match a {
|
||||
AgentID::Car(_) => true,
|
||||
_ => false,
|
||||
})
|
||||
.any(|a| matches!(a, AgentID::Car(_)))
|
||||
{
|
||||
return format!("someone's turning in {} still", i);
|
||||
}
|
||||
|
@ -570,14 +570,8 @@ impl Pedestrian {
|
||||
PedState::WaitingToTurn(_, _) => Some(self.path.next_step().as_turn()),
|
||||
_ => None,
|
||||
},
|
||||
preparing_bike: match self.state {
|
||||
PedState::StartingToBike(_, _, _) | PedState::FinishingBiking(_, _, _) => true,
|
||||
_ => false,
|
||||
},
|
||||
waiting_for_bus: match self.state {
|
||||
PedState::WaitingForBus(_, _) => true,
|
||||
_ => false,
|
||||
},
|
||||
preparing_bike: matches!(self.state, PedState::StartingToBike(_, _, _) | PedState::FinishingBiking(_, _, _)),
|
||||
waiting_for_bus: matches!(self.state, PedState::WaitingForBus(_, _)),
|
||||
on,
|
||||
metadata: self.metadata(now),
|
||||
}
|
||||
|
@ -613,11 +613,7 @@ impl Trip {
|
||||
}
|
||||
|
||||
fn is_bus_trip(&self) -> bool {
|
||||
self.legs.len() == 1
|
||||
&& match self.legs[0] {
|
||||
TripLeg::ServeBusRoute(_, _) => true,
|
||||
_ => false,
|
||||
}
|
||||
self.legs.len() == 1 && matches!(self.legs[0], TripLeg::ServeBusRoute(_, _))
|
||||
}
|
||||
|
||||
// Returns true if this succeeds. If not, trip aborted.
|
||||
|
Loading…
Reference in New Issue
Block a user