From 2a3522783cecf9636819d00e78e50601d7976438 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Thu, 31 Aug 2023 13:37:39 +0700 Subject: [PATCH] cargo fmt This fixes that presumably started getting formatted with Rust 1.72. --- crates/encoding/src/resolve.rs | 4 +++- crates/shaders/src/compile/mod.rs | 12 +++++------- examples/with_winit/src/lib.rs | 12 +++++++++--- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/crates/encoding/src/resolve.rs b/crates/encoding/src/resolve.rs index a1d3eed58..dfd89bc8d 100644 --- a/crates/encoding/src/resolve.rs +++ b/crates/encoding/src/resolve.rs @@ -415,7 +415,9 @@ impl Resolver { let run = &resources.glyph_runs[*index]; let font_id = run.font.data.id(); let font_size_u32 = run.font_size.to_bits(); - let Ok(font_file) = fello::raw::FileRef::new(run.font.data.as_ref()) else { continue }; + let Ok(font_file) = fello::raw::FileRef::new(run.font.data.as_ref()) else { + continue; + }; let font = match font_file { fello::raw::FileRef::Font(font) => Some(font), fello::raw::FileRef::Collection(collection) => { diff --git a/crates/shaders/src/compile/mod.rs b/crates/shaders/src/compile/mod.rs index 12005c52a..5325902b6 100644 --- a/crates/shaders/src/compile/mod.rs +++ b/crates/shaders/src/compile/mod.rs @@ -78,14 +78,12 @@ impl ShaderInfo { size: ArraySize::Constant(size), stride, .. - } => { - u32::from(*size) * stride - }, + } => u32::from(*size) * stride, naga::TypeInner::Struct { span, .. } => *span, - naga::TypeInner::Scalar { width, ..} => *width as u32, - naga::TypeInner::Vector { width, ..} => *width as u32, - naga::TypeInner::Matrix { width, ..} => *width as u32, - naga::TypeInner::Atomic { width, ..} => *width as u32, + naga::TypeInner::Scalar { width, .. } => *width as u32, + naga::TypeInner::Vector { width, .. } => *width as u32, + naga::TypeInner::Matrix { width, .. } => *width as u32, + naga::TypeInner::Atomic { width, .. } => *width as u32, _ => { // Not a valid workgroup variable type. At least not one that is used // in our shaders. diff --git a/examples/with_winit/src/lib.rs b/examples/with_winit/src/lib.rs index 961c5fca9..62737df34 100644 --- a/examples/with_winit/src/lib.rs +++ b/examples/with_winit/src/lib.rs @@ -131,7 +131,9 @@ fn run( ref event, window_id, } => { - let Some(render_state) = &mut render_state else { return }; + let Some(render_state) = &mut render_state else { + return; + }; if render_state.window.id() != window_id { return; } @@ -307,7 +309,9 @@ fn run( } } Event::RedrawRequested(_) => { - let Some(render_state) = &mut render_state else { return }; + let Some(render_state) = &mut render_state else { + return; + }; let width = render_state.surface.config.width; let height = render_state.surface.config.height; let device_handle = &render_cx.devices[render_state.surface.dev_id]; @@ -436,7 +440,9 @@ fn run( Event::UserEvent(event) => match event { #[cfg(not(any(target_arch = "wasm32", target_os = "android")))] UserEvent::HotReload => { - let Some(render_state) = &mut render_state else { return }; + let Some(render_state) = &mut render_state else { + return; + }; let device_handle = &render_cx.devices[render_state.surface.dev_id]; eprintln!("==============\nReloading shaders"); let start = Instant::now();