Skip to content

Commit

Permalink
Resolve Rust 1.66 clippy lints (#3304)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErichDonGubler authored Dec 16, 2022
1 parent f14bee6 commit 3cc6621
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
3 changes: 1 addition & 2 deletions wgpu-core/src/device/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5242,8 +5242,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
};

let num_frames = present::DESIRED_NUM_FRAMES
.max(*caps.swap_chain_sizes.start())
.min(*caps.swap_chain_sizes.end());
.clamp(*caps.swap_chain_sizes.start(), *caps.swap_chain_sizes.end());
let mut hal_config = hal::SurfaceConfiguration {
swap_chain_size: num_frames,
present_mode: config.present_mode,
Expand Down
7 changes: 4 additions & 3 deletions wgpu-hal/examples/halmark/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,10 @@ impl<A: hal::Api> Example<A> {

let window_size: (u32, u32) = window.inner_size().into();
let surface_config = hal::SurfaceConfiguration {
swap_chain_size: DESIRED_FRAMES
.max(*surface_caps.swap_chain_sizes.start())
.min(*surface_caps.swap_chain_sizes.end()),
swap_chain_size: DESIRED_FRAMES.clamp(
*surface_caps.swap_chain_sizes.start(),
*surface_caps.swap_chain_sizes.end(),
),
present_mode: wgt::PresentMode::Fifo,
composite_alpha_mode: wgt::CompositeAlphaMode::Opaque,
format: wgt::TextureFormat::Bgra8UnormSrgb,
Expand Down
2 changes: 1 addition & 1 deletion wgpu/examples/skybox/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ impl framework::Example for Skybox {
queue,
&wgpu::TextureDescriptor {
size,
mip_level_count: max_mips as u32,
mip_level_count: max_mips,
sample_count: 1,
dimension: wgpu::TextureDimension::D2,
format: skybox_format,
Expand Down
2 changes: 1 addition & 1 deletion wgpu/src/util/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl DeviceExt for crate::Device {
queue.write_texture(
crate::ImageCopyTexture {
texture: &texture,
mip_level: mip as u32,
mip_level: mip,
origin: crate::Origin3d {
x: 0,
y: 0,
Expand Down
2 changes: 1 addition & 1 deletion wgpu/tests/common/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pub fn compare_image_output(

write_png(actual_path, width, height, data, png::Compression::Fast);
write_png(
&difference_path,
difference_path,
width,
height,
&difference_data,
Expand Down

0 comments on commit 3cc6621

Please sign in to comment.