From d69e9605a2b0ece82b575a227f227c9f97673908 Mon Sep 17 00:00:00 2001 From: Jay Oster Date: Sun, 29 Mar 2026 23:01:45 -0700 Subject: [PATCH 1/4] Update all packages to Edition 2024 --- Cargo.toml | 2 +- examples/conway/Cargo.toml | 2 +- examples/custom-shader/Cargo.toml | 2 +- examples/custom-shader/src/renderers.rs | 3 +-- examples/imgui-winit/Cargo.toml | 2 +- examples/imgui-winit/src/gui.rs | 2 +- examples/invaders/Cargo.toml | 2 +- examples/invaders/src/main.rs | 4 ++-- examples/minimal-egui/Cargo.toml | 2 +- examples/minimal-egui/src/gui.rs | 2 +- examples/minimal-fltk/Cargo.toml | 2 +- examples/minimal-tao/Cargo.toml | 2 +- examples/minimal-web/Cargo.toml | 2 +- examples/minimal-winit-android/Cargo.toml | 2 +- examples/minimal-winit/Cargo.toml | 2 +- examples/raqote-winit/Cargo.toml | 2 +- examples/tiny-skia-winit/Cargo.toml | 2 +- internals/pixels-mocks/Cargo.toml | 2 +- run-wasm/Cargo.toml | 3 ++- src/lib.rs | 2 +- 20 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ef6c0135..dc5a3d79 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "pixels" description = "A tiny library providing a GPU-powered pixel frame buffer." version = "0.16.0" authors = ["Jay Oster "] -edition = "2021" +edition = "2024" rust-version = "1.88.0" repository = "https://github.com/parasyte/pixels" readme = "README.md" diff --git a/examples/conway/Cargo.toml b/examples/conway/Cargo.toml index 2bf53119..c1d7ee87 100644 --- a/examples/conway/Cargo.toml +++ b/examples/conway/Cargo.toml @@ -2,7 +2,7 @@ name = "conway" version = "0.1.0" authors = ["Jay Oster "] -edition = "2021" +edition = "2024" publish = false [features] diff --git a/examples/custom-shader/Cargo.toml b/examples/custom-shader/Cargo.toml index d7c83f46..08212b2d 100644 --- a/examples/custom-shader/Cargo.toml +++ b/examples/custom-shader/Cargo.toml @@ -2,7 +2,7 @@ name = "custom-shader" version = "0.1.0" authors = ["Jay Oster "] -edition = "2021" +edition = "2024" publish = false [features] diff --git a/examples/custom-shader/src/renderers.rs b/examples/custom-shader/src/renderers.rs index 7465f189..0099630b 100644 --- a/examples/custom-shader/src/renderers.rs +++ b/examples/custom-shader/src/renderers.rs @@ -1,7 +1,6 @@ use pixels::{ - check_texture_size, + TextureError, check_texture_size, wgpu::{self, util::DeviceExt}, - TextureError, }; pub(crate) struct NoiseRenderer { diff --git a/examples/imgui-winit/Cargo.toml b/examples/imgui-winit/Cargo.toml index af451853..69a0ee6c 100644 --- a/examples/imgui-winit/Cargo.toml +++ b/examples/imgui-winit/Cargo.toml @@ -2,7 +2,7 @@ name = "imgui-winit" version = "0.1.0" authors = ["Jay Oster "] -edition = "2021" +edition = "2024" publish = false [features] diff --git a/examples/imgui-winit/src/gui.rs b/examples/imgui-winit/src/gui.rs index 132cdd9a..2ea2762e 100644 --- a/examples/imgui-winit/src/gui.rs +++ b/examples/imgui-winit/src/gui.rs @@ -1,4 +1,4 @@ -use pixels::{wgpu, PixelsContext}; +use pixels::{PixelsContext, wgpu}; use std::time::Instant; /// Manages all state required for rendering Dear ImGui over `Pixels`. diff --git a/examples/invaders/Cargo.toml b/examples/invaders/Cargo.toml index e320d486..66fcbc87 100644 --- a/examples/invaders/Cargo.toml +++ b/examples/invaders/Cargo.toml @@ -2,7 +2,7 @@ name = "invaders" version = "0.1.0" authors = ["Jay Oster "] -edition = "2021" +edition = "2024" publish = false [features] diff --git a/examples/invaders/src/main.rs b/examples/invaders/src/main.rs index b8b36769..b3f0aecc 100644 --- a/examples/invaders/src/main.rs +++ b/examples/invaders/src/main.rs @@ -2,11 +2,11 @@ #![forbid(unsafe_code)] use error_iter::ErrorIter as _; -use game_loop::{game_loop, Time, TimeTrait as _}; +use game_loop::{Time, TimeTrait as _, game_loop}; use gilrs::{Button, GamepadId, Gilrs}; use log::{debug, error}; use pixels::{Error, Pixels, SurfaceTexture}; -use simple_invaders::{Controls, Direction, World, FPS, HEIGHT, TIME_STEP, WIDTH}; +use simple_invaders::{Controls, Direction, FPS, HEIGHT, TIME_STEP, WIDTH, World}; use std::sync::Arc; use std::{env, time::Duration}; use winit::{ diff --git a/examples/minimal-egui/Cargo.toml b/examples/minimal-egui/Cargo.toml index 55e550a7..d75f45a9 100644 --- a/examples/minimal-egui/Cargo.toml +++ b/examples/minimal-egui/Cargo.toml @@ -2,7 +2,7 @@ name = "minimal-egui" version = "0.1.0" authors = ["Jay Oster "] -edition = "2021" +edition = "2024" publish = false [features] diff --git a/examples/minimal-egui/src/gui.rs b/examples/minimal-egui/src/gui.rs index d324585b..392c827b 100644 --- a/examples/minimal-egui/src/gui.rs +++ b/examples/minimal-egui/src/gui.rs @@ -1,6 +1,6 @@ use egui::{ClippedPrimitive, Context, TexturesDelta, ViewportId}; use egui_wgpu::{Renderer, RendererOptions, ScreenDescriptor}; -use pixels::{wgpu, PixelsContext}; +use pixels::{PixelsContext, wgpu}; use winit::{event_loop::ActiveEventLoop, window::Window}; /// Manages all state required for rendering egui over `Pixels`. diff --git a/examples/minimal-fltk/Cargo.toml b/examples/minimal-fltk/Cargo.toml index 133d7018..8e9812a7 100644 --- a/examples/minimal-fltk/Cargo.toml +++ b/examples/minimal-fltk/Cargo.toml @@ -2,7 +2,7 @@ name = "minimal-fltk" version = "0.1.0" authors = ["Jay Oster "] -edition = "2021" +edition = "2024" publish = false [features] diff --git a/examples/minimal-tao/Cargo.toml b/examples/minimal-tao/Cargo.toml index 831338bf..f48420b5 100644 --- a/examples/minimal-tao/Cargo.toml +++ b/examples/minimal-tao/Cargo.toml @@ -2,7 +2,7 @@ name = "minimal-tao" version = "0.1.0" authors = ["Jay Oster "] -edition = "2021" +edition = "2024" publish = false [features] diff --git a/examples/minimal-web/Cargo.toml b/examples/minimal-web/Cargo.toml index dee1f16d..48057c4b 100644 --- a/examples/minimal-web/Cargo.toml +++ b/examples/minimal-web/Cargo.toml @@ -2,7 +2,7 @@ name = "minimal-web" version = "0.1.0" authors = ["Jay Oster "] -edition = "2021" +edition = "2024" publish = false [features] diff --git a/examples/minimal-winit-android/Cargo.toml b/examples/minimal-winit-android/Cargo.toml index d367fada..a4792eea 100644 --- a/examples/minimal-winit-android/Cargo.toml +++ b/examples/minimal-winit-android/Cargo.toml @@ -2,7 +2,7 @@ name = "minimal-winit-android" version = "0.1.0" authors = ["Randommist "] -edition = "2021" +edition = "2024" publish = false [dependencies] diff --git a/examples/minimal-winit/Cargo.toml b/examples/minimal-winit/Cargo.toml index 1066129b..a6443b3d 100644 --- a/examples/minimal-winit/Cargo.toml +++ b/examples/minimal-winit/Cargo.toml @@ -2,7 +2,7 @@ name = "minimal-winit" version = "0.1.0" authors = ["Jay Oster "] -edition = "2021" +edition = "2024" publish = false [features] diff --git a/examples/raqote-winit/Cargo.toml b/examples/raqote-winit/Cargo.toml index 4eb9333e..a19b0e0c 100644 --- a/examples/raqote-winit/Cargo.toml +++ b/examples/raqote-winit/Cargo.toml @@ -2,7 +2,7 @@ name = "raqote-winit" version = "0.1.0" authors = ["Jay Oster "] -edition = "2021" +edition = "2024" publish = false [features] diff --git a/examples/tiny-skia-winit/Cargo.toml b/examples/tiny-skia-winit/Cargo.toml index b0c46d72..b7497988 100644 --- a/examples/tiny-skia-winit/Cargo.toml +++ b/examples/tiny-skia-winit/Cargo.toml @@ -2,7 +2,7 @@ name = "tiny-skia-winit" version = "0.1.0" authors = ["Jeffrey Rosenbluth "] -edition = "2021" +edition = "2024" publish = false [dependencies] diff --git a/run-wasm/Cargo.toml b/run-wasm/Cargo.toml index a2c0b813..84a8c9df 100644 --- a/run-wasm/Cargo.toml +++ b/run-wasm/Cargo.toml @@ -1,7 +1,8 @@ [package] name = "run-wasm" version = "0.1.0" -edition = "2021" +edition = "2024" +publish = false [dependencies] cargo-run-wasm = "0.3" diff --git a/src/lib.rs b/src/lib.rs index e885bffe..ad843fdb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -32,7 +32,7 @@ #![deny(clippy::all)] #![forbid(unsafe_code)] -pub use crate::builder::{check_texture_size, PixelsBuilder}; +pub use crate::builder::{PixelsBuilder, check_texture_size}; pub use crate::renderers::ScalingRenderer; pub use raw_window_handle; use thiserror::Error; From 9a9bb0bd8ebc06d842ed99cbf017c8491d1dc4b7 Mon Sep 17 00:00:00 2001 From: Jay Oster Date: Sun, 29 Mar 2026 23:07:36 -0700 Subject: [PATCH 2/4] cargo clippy --- examples/conway/src/main.rs | 5 ++--- examples/imgui-winit/src/main.rs | 5 ++--- examples/invaders/simple-invaders/src/lib.rs | 10 ++++------ examples/invaders/src/main.rs | 10 ++++------ examples/minimal-fltk/src/main.rs | 5 ++--- examples/minimal-tao/src/main.rs | 5 ++--- examples/minimal-winit/src/main.rs | 5 ++--- examples/raqote-winit/src/main.rs | 5 ++--- examples/tiny-skia-winit/src/main.rs | 5 ++--- 9 files changed, 22 insertions(+), 33 deletions(-) diff --git a/examples/conway/src/main.rs b/examples/conway/src/main.rs index 0e259979..f78d8422 100644 --- a/examples/conway/src/main.rs +++ b/examples/conway/src/main.rs @@ -128,13 +128,12 @@ fn main() -> Result<(), Error> { } } // Resize the window - if let Some(size) = input.window_resized() { - if let Err(err) = pixels.resize_surface(size.width, size.height) { + if let Some(size) = input.window_resized() + && let Err(err) = pixels.resize_surface(size.width, size.height) { log_error("pixels.resize_surface", err); elwt.exit(); return; } - } } // Draw the current frame diff --git a/examples/imgui-winit/src/main.rs b/examples/imgui-winit/src/main.rs index 2a7edbb5..e81c093d 100644 --- a/examples/imgui-winit/src/main.rs +++ b/examples/imgui-winit/src/main.rs @@ -91,8 +91,8 @@ fn main() -> Result<(), Error> { } // Resize the window - if let Some(size) = input.window_resized() { - if size.width > 0 && size.height > 0 { + if let Some(size) = input.window_resized() + && size.width > 0 && size.height > 0 { // Resize the surface texture if let Err(err) = pixels.resize_surface(size.width, size.height) { log_error("pixels.resize_surface", err); @@ -107,7 +107,6 @@ fn main() -> Result<(), Error> { return event_loop.exit(); } } - } } // Draw the current frame diff --git a/examples/invaders/simple-invaders/src/lib.rs b/examples/invaders/simple-invaders/src/lib.rs index 92cb9efd..f2184505 100644 --- a/examples/invaders/simple-invaders/src/lib.rs +++ b/examples/invaders/simple-invaders/src/lib.rs @@ -408,19 +408,17 @@ impl World { let width = self.player.sprite.width(); match controls.direction { - Direction::Left => { - if self.player.pos.x > width { + Direction::Left + if self.player.pos.x > width => { self.player.pos.x -= frames; self.player.sprite.animate(&self.assets); } - } - Direction::Right => { - if self.player.pos.x < WIDTH - width * 2 { + Direction::Right + if self.player.pos.x < WIDTH - width * 2 => { self.player.pos.x += frames; self.player.sprite.animate(&self.assets); } - } _ => (), } diff --git a/examples/invaders/src/main.rs b/examples/invaders/src/main.rs index b3f0aecc..30e2a6f4 100644 --- a/examples/invaders/src/main.rs +++ b/examples/invaders/src/main.rs @@ -175,9 +175,9 @@ fn main() -> Result<(), Error> { Event::DeviceEvent { event, .. } => { g.game.input.process_device_event(event); } - Event::WindowEvent { event, .. } => { + Event::WindowEvent { event, .. } // Let winit_input_helper collect events to build its state. - if g.game.input.process_window_event(event) { + if g.game.input.process_window_event(event) => { // Update controls g.game.update_controls(); @@ -195,15 +195,13 @@ fn main() -> Result<(), Error> { } // Resize the window - if let Some(size) = g.game.input.window_resized() { - if let Err(err) = g.game.pixels.resize_surface(size.width, size.height) + if let Some(size) = g.game.input.window_resized() + && let Err(err) = g.game.pixels.resize_surface(size.width, size.height) { log_error("pixels.resize_surface", err); g.exit(); } - } } - } _ => {} } }, diff --git a/examples/minimal-fltk/src/main.rs b/examples/minimal-fltk/src/main.rs index 7b77ef30..b4da363f 100644 --- a/examples/minimal-fltk/src/main.rs +++ b/examples/minimal-fltk/src/main.rs @@ -58,12 +58,11 @@ fn main() -> Result<(), Error> { world.update(); // Resize the window - if let Some((width, height)) = surface_size.borrow_mut().take() { - if let Err(err) = pixels.resize_surface(width, height) { + if let Some((width, height)) = surface_size.borrow_mut().take() + && let Err(err) = pixels.resize_surface(width, height) { log_error("pixels.resize_surface", err); app.quit(); } - } // Draw the current frame world.draw(pixels.frame_mut()); diff --git a/examples/minimal-tao/src/main.rs b/examples/minimal-tao/src/main.rs index c535a01d..6c76903f 100644 --- a/examples/minimal-tao/src/main.rs +++ b/examples/minimal-tao/src/main.rs @@ -130,11 +130,10 @@ fn main() -> Result<(), Error> { _ => { // Handle menu events - if let Ok(event) = MenuEvent::receiver().try_recv() { - if event.id.0 == "quit" { + if let Ok(event) = MenuEvent::receiver().try_recv() + && event.id.0 == "quit" { *control_flow = ControlFlow::Exit; } - } } } }); diff --git a/examples/minimal-winit/src/main.rs b/examples/minimal-winit/src/main.rs index 210c5d45..01948893 100644 --- a/examples/minimal-winit/src/main.rs +++ b/examples/minimal-winit/src/main.rs @@ -70,13 +70,12 @@ fn main() -> Result<(), Error> { } // Resize the window - if let Some(size) = input.window_resized() { - if let Err(err) = pixels.resize_surface(size.width, size.height) { + if let Some(size) = input.window_resized() + && let Err(err) = pixels.resize_surface(size.width, size.height) { log_error("pixels.resize_surface", err); elwt.exit(); return; } - } } // Draw the current frame diff --git a/examples/raqote-winit/src/main.rs b/examples/raqote-winit/src/main.rs index 9baf564a..44892691 100644 --- a/examples/raqote-winit/src/main.rs +++ b/examples/raqote-winit/src/main.rs @@ -69,13 +69,12 @@ fn main() -> Result<(), Error> { } // Resize the window - if let Some(size) = input.window_resized() { - if let Err(err) = pixels.resize_surface(size.width, size.height) { + if let Some(size) = input.window_resized() + && let Err(err) = pixels.resize_surface(size.width, size.height) { log_error("pixels.resize_surface", err); elwt.exit(); return; } - } } // Draw the current frame diff --git a/examples/tiny-skia-winit/src/main.rs b/examples/tiny-skia-winit/src/main.rs index cce49408..d9914a71 100644 --- a/examples/tiny-skia-winit/src/main.rs +++ b/examples/tiny-skia-winit/src/main.rs @@ -67,13 +67,12 @@ fn main() -> Result<(), Error> { } // Resize the window - if let Some(size) = input.window_resized() { - if let Err(err) = pixels.resize_surface(size.width, size.height) { + if let Some(size) = input.window_resized() + && let Err(err) = pixels.resize_surface(size.width, size.height) { log_error("pixels.resize_surface", err); elwt.exit(); return; } - } } // Draw the current frame From a4f2aac5c7830ae19fb0987d21da4ac3389fc1fb Mon Sep 17 00:00:00 2001 From: Jay Oster Date: Sun, 29 Mar 2026 23:16:38 -0700 Subject: [PATCH 3/4] no_mangle was made unsafe in the 2024 edition --- examples/minimal-winit-android/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/minimal-winit-android/src/lib.rs b/examples/minimal-winit-android/src/lib.rs index b4a7bbcf..001bd04a 100644 --- a/examples/minimal-winit-android/src/lib.rs +++ b/examples/minimal-winit-android/src/lib.rs @@ -135,7 +135,7 @@ impl World { } #[cfg(target_os = "android")] -#[no_mangle] +#[unsafe(no_mangle)] fn android_main(app: AndroidApp) { use android_logger::Config; use winit::event_loop::EventLoop; From 47bf63166007bb49d887293df3959d8e18c714e6 Mon Sep 17 00:00:00 2001 From: Jay Oster Date: Sun, 29 Mar 2026 23:21:14 -0700 Subject: [PATCH 4/4] cargo fmt --- examples/conway/src/main.rs | 11 +++---- examples/imgui-winit/src/main.rs | 30 +++++++++++--------- examples/invaders/simple-invaders/src/lib.rs | 18 ++++++------ examples/minimal-fltk/src/main.rs | 9 +++--- examples/minimal-tao/src/main.rs | 7 +++-- examples/minimal-winit/src/main.rs | 11 +++---- examples/raqote-winit/src/main.rs | 11 +++---- examples/tiny-skia-winit/src/main.rs | 11 +++---- 8 files changed, 57 insertions(+), 51 deletions(-) diff --git a/examples/conway/src/main.rs b/examples/conway/src/main.rs index f78d8422..cadb7613 100644 --- a/examples/conway/src/main.rs +++ b/examples/conway/src/main.rs @@ -129,11 +129,12 @@ fn main() -> Result<(), Error> { } // Resize the window if let Some(size) = input.window_resized() - && let Err(err) = pixels.resize_surface(size.width, size.height) { - log_error("pixels.resize_surface", err); - elwt.exit(); - return; - } + && let Err(err) = pixels.resize_surface(size.width, size.height) + { + log_error("pixels.resize_surface", err); + elwt.exit(); + return; + } } // Draw the current frame diff --git a/examples/imgui-winit/src/main.rs b/examples/imgui-winit/src/main.rs index e81c093d..ac2c80dc 100644 --- a/examples/imgui-winit/src/main.rs +++ b/examples/imgui-winit/src/main.rs @@ -92,21 +92,23 @@ fn main() -> Result<(), Error> { // Resize the window if let Some(size) = input.window_resized() - && size.width > 0 && size.height > 0 { - // Resize the surface texture - if let Err(err) = pixels.resize_surface(size.width, size.height) { - log_error("pixels.resize_surface", err); - return event_loop.exit(); - } - - // Resize the world - let LogicalSize { width, height } = size.to_logical(scale_factor); - world.resize(width, height); - if let Err(err) = pixels.resize_buffer(width, height) { - log_error("pixels.resize_buffer", err); - return event_loop.exit(); - } + && size.width > 0 + && size.height > 0 + { + // Resize the surface texture + if let Err(err) = pixels.resize_surface(size.width, size.height) { + log_error("pixels.resize_surface", err); + return event_loop.exit(); } + + // Resize the world + let LogicalSize { width, height } = size.to_logical(scale_factor); + world.resize(width, height); + if let Err(err) = pixels.resize_buffer(width, height) { + log_error("pixels.resize_buffer", err); + return event_loop.exit(); + } + } } // Draw the current frame diff --git a/examples/invaders/simple-invaders/src/lib.rs b/examples/invaders/simple-invaders/src/lib.rs index f2184505..33e33dd0 100644 --- a/examples/invaders/simple-invaders/src/lib.rs +++ b/examples/invaders/simple-invaders/src/lib.rs @@ -408,17 +408,15 @@ impl World { let width = self.player.sprite.width(); match controls.direction { - Direction::Left - if self.player.pos.x > width => { - self.player.pos.x -= frames; - self.player.sprite.animate(&self.assets); - } + Direction::Left if self.player.pos.x > width => { + self.player.pos.x -= frames; + self.player.sprite.animate(&self.assets); + } - Direction::Right - if self.player.pos.x < WIDTH - width * 2 => { - self.player.pos.x += frames; - self.player.sprite.animate(&self.assets); - } + Direction::Right if self.player.pos.x < WIDTH - width * 2 => { + self.player.pos.x += frames; + self.player.sprite.animate(&self.assets); + } _ => (), } diff --git a/examples/minimal-fltk/src/main.rs b/examples/minimal-fltk/src/main.rs index b4da363f..5700a931 100644 --- a/examples/minimal-fltk/src/main.rs +++ b/examples/minimal-fltk/src/main.rs @@ -59,10 +59,11 @@ fn main() -> Result<(), Error> { // Resize the window if let Some((width, height)) = surface_size.borrow_mut().take() - && let Err(err) = pixels.resize_surface(width, height) { - log_error("pixels.resize_surface", err); - app.quit(); - } + && let Err(err) = pixels.resize_surface(width, height) + { + log_error("pixels.resize_surface", err); + app.quit(); + } // Draw the current frame world.draw(pixels.frame_mut()); diff --git a/examples/minimal-tao/src/main.rs b/examples/minimal-tao/src/main.rs index 6c76903f..3b6b6984 100644 --- a/examples/minimal-tao/src/main.rs +++ b/examples/minimal-tao/src/main.rs @@ -131,9 +131,10 @@ fn main() -> Result<(), Error> { _ => { // Handle menu events if let Ok(event) = MenuEvent::receiver().try_recv() - && event.id.0 == "quit" { - *control_flow = ControlFlow::Exit; - } + && event.id.0 == "quit" + { + *control_flow = ControlFlow::Exit; + } } } }); diff --git a/examples/minimal-winit/src/main.rs b/examples/minimal-winit/src/main.rs index 01948893..87f56388 100644 --- a/examples/minimal-winit/src/main.rs +++ b/examples/minimal-winit/src/main.rs @@ -71,11 +71,12 @@ fn main() -> Result<(), Error> { // Resize the window if let Some(size) = input.window_resized() - && let Err(err) = pixels.resize_surface(size.width, size.height) { - log_error("pixels.resize_surface", err); - elwt.exit(); - return; - } + && let Err(err) = pixels.resize_surface(size.width, size.height) + { + log_error("pixels.resize_surface", err); + elwt.exit(); + return; + } } // Draw the current frame diff --git a/examples/raqote-winit/src/main.rs b/examples/raqote-winit/src/main.rs index 44892691..10921a21 100644 --- a/examples/raqote-winit/src/main.rs +++ b/examples/raqote-winit/src/main.rs @@ -70,11 +70,12 @@ fn main() -> Result<(), Error> { // Resize the window if let Some(size) = input.window_resized() - && let Err(err) = pixels.resize_surface(size.width, size.height) { - log_error("pixels.resize_surface", err); - elwt.exit(); - return; - } + && let Err(err) = pixels.resize_surface(size.width, size.height) + { + log_error("pixels.resize_surface", err); + elwt.exit(); + return; + } } // Draw the current frame diff --git a/examples/tiny-skia-winit/src/main.rs b/examples/tiny-skia-winit/src/main.rs index d9914a71..4665fcbc 100644 --- a/examples/tiny-skia-winit/src/main.rs +++ b/examples/tiny-skia-winit/src/main.rs @@ -68,11 +68,12 @@ fn main() -> Result<(), Error> { // Resize the window if let Some(size) = input.window_resized() - && let Err(err) = pixels.resize_surface(size.width, size.height) { - log_error("pixels.resize_surface", err); - elwt.exit(); - return; - } + && let Err(err) = pixels.resize_surface(size.width, size.height) + { + log_error("pixels.resize_surface", err); + elwt.exit(); + return; + } } // Draw the current frame