Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien-ben committed Jul 17, 2024
1 parent 1d28b17 commit 801b23a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions crates/libs/model/src/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ fn get_next_rgba(pixels: &[u8], format: Format, index: usize) -> [u8; 4] {
use Format::*;
match format {
// actually luma8
R8 => [pixels[index], pixels[index], pixels[index], std::u8::MAX],
R8 => [pixels[index], pixels[index], pixels[index], u8::MAX],
// actually luma8 with alpha
R8G8 => [
pixels[index * 2],
Expand All @@ -136,7 +136,7 @@ fn get_next_rgba(pixels: &[u8], format: Format, index: usize) -> [u8; 4] {
pixels[index * 3],
pixels[index * 3 + 1],
pixels[index * 3 + 2],
std::u8::MAX,
u8::MAX,
],
R8G8B8A8 => [
pixels[index * 4],
Expand Down
4 changes: 2 additions & 2 deletions crates/libs/vulkan/src/swapchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ impl Swapchain {
unsafe {
self.swapchain.acquire_next_image(
self.swapchain_khr,
timeout.unwrap_or(std::u64::MAX),
timeout.unwrap_or(u64::MAX),
semaphore.unwrap_or_else(vk::Semaphore::null),
fence.unwrap_or_else(vk::Fence::null),
)
Expand Down Expand Up @@ -319,7 +319,7 @@ impl SwapchainSupportDetails {
capabilities: vk::SurfaceCapabilitiesKHR,
preferred_dimensions: [u32; 2],
) -> vk::Extent2D {
if capabilities.current_extent.width != std::u32::MAX {
if capabilities.current_extent.width != u32::MAX {
return capabilities.current_extent;
}

Expand Down
4 changes: 2 additions & 2 deletions crates/viewer/src/renderer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ impl Renderer {
unsafe {
self.context
.device()
.wait_for_fences(&wait_fences, true, std::u64::MAX)
.wait_for_fences(&wait_fences, true, u64::MAX)
.unwrap()
};

Expand Down Expand Up @@ -807,7 +807,7 @@ impl Renderer {
command_buffer,
extent,
*pixels_per_point,
&clipped_primitives,
clipped_primitives,
)
.unwrap();
}
Expand Down
4 changes: 2 additions & 2 deletions crates/viewer/src/renderer/model/gbufferpass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl GBufferPass {
camera_buffers: &[Buffer],
depth_format: vk::Format,
) -> Self {
let dummy_texture = VulkanTexture::from_rgba(&context, 1, 1, &[std::u8::MAX; 4], true);
let dummy_texture = VulkanTexture::from_rgba(&context, 1, 1, &[u8::MAX; 4], true);

let model_rc = model_data
.model
Expand Down Expand Up @@ -608,7 +608,7 @@ pub struct MaterialUniform {
}

impl MaterialUniform {
const NO_TEXTURE_ID: u32 = std::u8::MAX as u32;
const NO_TEXTURE_ID: u32 = u8::MAX as u32;
}

impl From<Material> for MaterialUniform {
Expand Down
2 changes: 1 addition & 1 deletion crates/viewer/src/renderer/model/lightpass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl LightPass {
depth_format: vk::Format,
settings: RendererSettings,
) -> Self {
let dummy_texture = VulkanTexture::from_rgba(&context, 1, 1, &[std::u8::MAX; 4], true);
let dummy_texture = VulkanTexture::from_rgba(&context, 1, 1, &[u8::MAX; 4], true);

let model_rc = model_data
.model
Expand Down

0 comments on commit 801b23a

Please sign in to comment.