diff --git a/examples/src/mipmap/mod.rs b/examples/src/mipmap/mod.rs index eaed9c82e..3e9250c70 100644 --- a/examples/src/mipmap/mod.rs +++ b/examples/src/mipmap/mod.rs @@ -30,7 +30,7 @@ fn create_texels(size: usize, cx: f32, cy: f32) -> Vec { iter::once(0xFF - (count * 2) as u8) .chain(iter::once(0xFF - (count * 5) as u8)) .chain(iter::once(0xFF - (count * 13) as u8)) - .chain(iter::once(std::u8::MAX)) + .chain(iter::once(u8::MAX)) }) .collect() } diff --git a/examples/src/water/point_gen.rs b/examples/src/water/point_gen.rs index bb657c8e0..a32cf7f8b 100644 --- a/examples/src/water/point_gen.rs +++ b/examples/src/water/point_gen.rs @@ -124,7 +124,7 @@ impl HexTerrainMesh { let width = q_given_r(radius); let half_width = (width / 2) as isize; let mut map = HashMap::new(); - let mut max = std::f32::NEG_INFINITY; + let mut max = f32::NEG_INFINITY; for i in -half_width..=half_width { let x_o = i as f32; for j in -half_width..=half_width { diff --git a/wgpu-core/src/init_tracker/texture.rs b/wgpu-core/src/init_tracker/texture.rs index a859b5f78..4785b5222 100644 --- a/wgpu-core/src/init_tracker/texture.rs +++ b/wgpu-core/src/init_tracker/texture.rs @@ -61,10 +61,10 @@ impl TextureInitTracker { &self, action: &TextureInitTrackerAction, ) -> Option> { - let mut mip_range_start = std::usize::MAX; - let mut mip_range_end = std::usize::MIN; - let mut layer_range_start = std::u32::MAX; - let mut layer_range_end = std::u32::MIN; + let mut mip_range_start = usize::MAX; + let mut mip_range_end = usize::MIN; + let mut layer_range_start = u32::MAX; + let mut layer_range_end = u32::MIN; for (i, mip_tracker) in self .mips diff --git a/wgpu-hal/src/gles/adapter.rs b/wgpu-hal/src/gles/adapter.rs index 052c77006..03c026aa2 100644 --- a/wgpu-hal/src/gles/adapter.rs +++ b/wgpu-hal/src/gles/adapter.rs @@ -797,7 +797,7 @@ impl super::Adapter { }, max_compute_workgroups_per_dimension, max_buffer_size: i32::MAX as u64, - max_non_sampler_bindings: std::u32::MAX, + max_non_sampler_bindings: u32::MAX, }; let mut workarounds = super::Workarounds::empty(); diff --git a/wgpu-hal/src/metal/adapter.rs b/wgpu-hal/src/metal/adapter.rs index cddba472b..067303ef7 100644 --- a/wgpu-hal/src/metal/adapter.rs +++ b/wgpu-hal/src/metal/adapter.rs @@ -981,7 +981,7 @@ impl super::PrivateCapabilities { max_compute_workgroup_size_z: self.max_threads_per_group, max_compute_workgroups_per_dimension: 0xFFFF, max_buffer_size: self.max_buffer_size, - max_non_sampler_bindings: std::u32::MAX, + max_non_sampler_bindings: u32::MAX, }, alignments: crate::Alignments { buffer_copy_offset: wgt::BufferSize::new(self.buffer_alignment).unwrap(), diff --git a/wgpu-hal/src/vulkan/adapter.rs b/wgpu-hal/src/vulkan/adapter.rs index 6641a24a7..6df999084 100644 --- a/wgpu-hal/src/vulkan/adapter.rs +++ b/wgpu-hal/src/vulkan/adapter.rs @@ -1047,7 +1047,7 @@ impl PhysicalDeviceProperties { max_compute_workgroup_size_z: max_compute_workgroup_sizes[2], max_compute_workgroups_per_dimension, max_buffer_size, - max_non_sampler_bindings: std::u32::MAX, + max_non_sampler_bindings: u32::MAX, } } @@ -1807,7 +1807,7 @@ impl super::Adapter { if let Some(maintenance_3) = self.phd_capabilities.maintenance_3 { maintenance_3.max_memory_allocation_size } else { - u64::max_value() + u64::MAX }; let properties = gpu_alloc::DeviceProperties { max_memory_allocation_count: limits.max_memory_allocation_count, diff --git a/wgpu/src/util/mod.rs b/wgpu/src/util/mod.rs index ce5af6fb6..d83263bcf 100644 --- a/wgpu/src/util/mod.rs +++ b/wgpu/src/util/mod.rs @@ -28,7 +28,7 @@ pub use wgt::{math::*, DispatchIndirectArgs, DrawIndexedIndirectArgs, DrawIndire /// This function panics if: /// /// - Input length isn't multiple of 4 -/// - Input is longer than [`usize::max_value`] +/// - Input is longer than [`usize::MAX`] /// - Input is empty /// - SPIR-V magic number is missing from beginning of stream #[cfg(feature = "spirv")]