-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid unwraps in winit fullscreen handling code #11735
Conversation
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd definitely like to avoid panicking here, but I don't love the nested options in an already dense area of code. Is there another way to express this control flow?
I believe this is probably the best it can be. On the other hand, this line can be shortened to a bevy/crates/bevy_winit/src/system.rs Line 124 in e42dacd
let Some(winit_window) = winit_windows.get_window(entity) else {
continue;
}; @Friz64, could you implement that change in your PR? |
Good suggestion, done. |
9c930ce
to
3485a80
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplified the code in some areas and avoided the unwrap with warnings, all good!
Objective
Solution