Resolve Rust 1.66 clippy lints (#3304)

This commit is contained in:
Erich Gubler 2022-12-16 15:23:12 -07:00 committed by GitHub
parent f14bee6740
commit 3cc6621fd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 8 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,