Fix some clippy warnings

This commit is contained in:
Dustin Carlino 2021-09-17 18:31:30 -07:00
parent ca4ddeb7a5
commit 2fc9010b1e
2 changed files with 5 additions and 6 deletions

View File

@ -367,8 +367,8 @@ impl RouteResults {
}
fn event(&mut self, ctx: &mut EventCtx, app: &App) -> Option<Transition> {
match self.panel.event(ctx) {
Outcome::Clicked(x) => match x.as_ref() {
if let Outcome::Clicked(x) = self.panel.event(ctx) {
match x.as_ref() {
"high-stress roads" => {
return Some(Transition::Push(PopupMsg::new_state(
ctx,
@ -385,8 +385,7 @@ impl RouteResults {
"traffic signals" => {}
"unprotected turns" => {}
_ => unreachable!(),
},
_ => {}
}
}
let current_dist_along = self

View File

@ -419,7 +419,7 @@ impl State<App> for MainState {
app.model.map.save();
}
"reload" => {
CameraState::save(&ctx.canvas, &app.model.map.name);
CameraState::save(ctx.canvas, &app.model.map.name);
return Transition::Push(crate::load::load_map(
ctx,
abstio::path_raw_map(&app.model.map.name),
@ -428,7 +428,7 @@ impl State<App> for MainState {
));
}
"open another RawMap" => {
CameraState::save(&ctx.canvas, &app.model.map.name);
CameraState::save(ctx.canvas, &app.model.map.name);
return Transition::Push(crate::load::PickMap::new_state(ctx));
}
_ => unreachable!(),