Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
This fixes that presumably started getting formatted with Rust 1.72.
  • Loading branch information
waywardmonkeys committed Aug 31, 2023
1 parent b121e94 commit 2a35227
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
4 changes: 3 additions & 1 deletion crates/encoding/src/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
12 changes: 5 additions & 7 deletions crates/shaders/src/compile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 9 additions & 3 deletions examples/with_winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 2a35227

Please sign in to comment.