1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-02 06:40:06 -04:00

Cleanup: replace std::iter::once(x) with [x]

This commit is contained in:
Emil Ernerfeldt
2023-11-14 18:47:29 +01:00
parent 1090d2db80
commit 0dd10bf0fa
3 changed files with 6 additions and 12 deletions

View File

@@ -657,7 +657,7 @@ mod glow_integration {
if let Some(window) = &viewport.window { if let Some(window) = &viewport.window {
let is_viewport_focused = focused_viewport == Some(viewport_id); let is_viewport_focused = focused_viewport == Some(viewport_id);
egui_winit::process_viewport_commands( egui_winit::process_viewport_commands(
std::iter::once(command), [command],
window, window,
is_viewport_focused, is_viewport_focused,
); );
@@ -2561,11 +2561,7 @@ mod wgpu_integration {
.and_then(|vp| vp.window.as_ref()) .and_then(|vp| vp.window.as_ref())
{ {
let is_viewport_focused = focused_viewport == Some(viewport_id); let is_viewport_focused = focused_viewport == Some(viewport_id);
egui_winit::process_viewport_commands( egui_winit::process_viewport_commands([command], window, is_viewport_focused);
std::iter::once(command),
window,
is_viewport_focused,
);
} }
} }

View File

@@ -270,11 +270,9 @@ impl WebPainter for WebPainterWgpu {
} }
// Submit the commands: both the main buffer and user-defined ones. // Submit the commands: both the main buffer and user-defined ones.
render_state.queue.submit( render_state
user_cmd_bufs .queue
.into_iter() .submit(user_cmd_bufs.into_iter().chain([encoder.finish()]));
.chain(std::iter::once(encoder.finish())),
);
if let Some(frame) = frame { if let Some(frame) = frame {
frame.present(); frame.present();

View File

@@ -615,7 +615,7 @@ impl Painter {
crate::profile_scope!("Queue::submit"); crate::profile_scope!("Queue::submit");
render_state render_state
.queue .queue
.submit(user_cmd_bufs.into_iter().chain(std::iter::once(encoded))); .submit(user_cmd_bufs.into_iter().chain([encoded]));
}; };
let screenshot = if capture { let screenshot = if capture {