mirror of
https://github.com/emilk/egui.git
synced 2026-06-27 15:13:12 -04:00
Cleanup: replace std::iter::once(x) with [x]
This commit is contained in:
@@ -657,7 +657,7 @@ mod glow_integration {
|
||||
if let Some(window) = &viewport.window {
|
||||
let is_viewport_focused = focused_viewport == Some(viewport_id);
|
||||
egui_winit::process_viewport_commands(
|
||||
std::iter::once(command),
|
||||
[command],
|
||||
window,
|
||||
is_viewport_focused,
|
||||
);
|
||||
@@ -2561,11 +2561,7 @@ mod wgpu_integration {
|
||||
.and_then(|vp| vp.window.as_ref())
|
||||
{
|
||||
let is_viewport_focused = focused_viewport == Some(viewport_id);
|
||||
egui_winit::process_viewport_commands(
|
||||
std::iter::once(command),
|
||||
window,
|
||||
is_viewport_focused,
|
||||
);
|
||||
egui_winit::process_viewport_commands([command], window, is_viewport_focused);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -270,11 +270,9 @@ impl WebPainter for WebPainterWgpu {
|
||||
}
|
||||
|
||||
// Submit the commands: both the main buffer and user-defined ones.
|
||||
render_state.queue.submit(
|
||||
user_cmd_bufs
|
||||
.into_iter()
|
||||
.chain(std::iter::once(encoder.finish())),
|
||||
);
|
||||
render_state
|
||||
.queue
|
||||
.submit(user_cmd_bufs.into_iter().chain([encoder.finish()]));
|
||||
|
||||
if let Some(frame) = frame {
|
||||
frame.present();
|
||||
|
||||
@@ -615,7 +615,7 @@ impl Painter {
|
||||
crate::profile_scope!("Queue::submit");
|
||||
render_state
|
||||
.queue
|
||||
.submit(user_cmd_bufs.into_iter().chain(std::iter::once(encoded)));
|
||||
.submit(user_cmd_bufs.into_iter().chain([encoded]));
|
||||
};
|
||||
|
||||
let screenshot = if capture {
|
||||
|
||||
Reference in New Issue
Block a user