We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a7e635f commit 81e68f6Copy full SHA for 81e68f6
crates/bevy_winit/src/winit_windows.rs
@@ -142,15 +142,10 @@ impl WinitWindows {
142
}
143
144
145
- // TODO: Might be more elegant ways to get return the reference of the winit-window
146
- let id = winit_window.id();
147
- self.windows.insert(winit_window.id(), winit_window);
148
- let created_window = self
149
- .windows
150
- .get(&id)
151
- .expect("Winit should alway have the window it just created");
152
-
153
- created_window
+ self.windows
+ .entry(winit_window.id())
+ .insert(winit_window)
+ .into_mut()
154
155
156
/// Get the winit window that is associated with our entity.
0 commit comments