Skip to content

Commit

Permalink
Apply @bjorn3's suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
DJMcNab committed Oct 1, 2021
1 parent 8e12719 commit 77b1a58
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions crates/bevy_winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ fn change_window(world: &mut World) {
}
}
}
if removed_windows.len() > 0 {
if !removed_windows.is_empty() {
let mut events = world.get_resource_mut::<Events<WindowClosed>>().unwrap();
for id in removed_windows {
windows.remove(id);
Expand Down Expand Up @@ -280,16 +280,19 @@ pub fn winit_runner_with(mut app: App, mut event_loop: EventLoop<()>) {
window_id
} else {
warn!(
"Skipped event for unknown winit Window Id {:?}",
winit_window_id
"Skipped event for unknown winit Window Id {:?}: {:?}",
winit_window_id, event
);
return;
};

let window = if let Some(window) = windows.get_mut(window_id) {
window
} else {
warn!("Skipped event for unknown Window Id {:?}", winit_window_id);
warn!(
"Skipped event for unknown Window Id {:?}: {:?}",
winit_window_id, event
);
return;
};

Expand Down

0 comments on commit 77b1a58

Please sign in to comment.