Fix clippy::unreadable_literal

This commit is contained in:
Héctor Ramón Jiménez 2023-09-20 05:19:24 +02:00
parent 1e4bade53a
commit 14ba939e67
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
3 changed files with 15 additions and 10 deletions

View file

@ -6,7 +6,7 @@ clippy --workspace --no-deps -- \
-D clippy::trivially-copy-pass-by-ref \
-D clippy::default_trait_access \
-D clippy::match-wildcard-for-single-variants \
-D clippy::redundant-closure-for-method-calls
-D clippy::redundant-closure-for-method-calls \
"""
nitpick = """
@ -30,5 +30,10 @@ clippy --workspace --no-deps -- \
-A clippy::if_not_else \
-A clippy::redundant_else \
-A clippy::used_underscore_binding \
-A clippy::cast_possible_wrap
-A clippy::cast_possible_wrap \
-A clippy::unnecessary_wraps \
-A clippy::struct-excessive-bools \
-A clippy::float-cmp \
-A clippy::single_match_else \
-A clippy::unreadable_literal
"""

View file

@ -172,9 +172,9 @@ impl Cache {
for pixel in
bytemuck::cast_slice_mut::<u8, u32>(image.data_mut())
{
*pixel = *pixel & 0xFF00FF00
| ((0x000000FF & *pixel) << 16)
| ((0x00FF0000 & *pixel) >> 16);
*pixel = *pixel & 0xFF00_FF00
| ((0x0000_00FF & *pixel) << 16)
| ((0x00FF_0000 & *pixel) >> 16);
}
}

View file

@ -329,12 +329,12 @@ impl Pipeline {
fn fragment_target(
texture_format: wgpu::TextureFormat,
) -> Option<wgpu::ColorTargetState> {
Some(wgpu::ColorTargetState {
) -> wgpu::ColorTargetState {
wgpu::ColorTargetState {
format: texture_format,
blend: Some(wgpu::BlendState::ALPHA_BLENDING),
write_mask: wgpu::ColorWrites::ALL,
})
}
}
fn primitive_state() -> wgpu::PrimitiveState {
@ -521,7 +521,7 @@ mod solid {
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "solid_fs_main",
targets: &[triangle::fragment_target(format)],
targets: &[Some(triangle::fragment_target(format))],
}),
primitive: triangle::primitive_state(),
depth_stencil: None,
@ -698,7 +698,7 @@ mod gradient {
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "gradient_fs_main",
targets: &[triangle::fragment_target(format)],
targets: &[Some(triangle::fragment_target(format))],
}),
primitive: triangle::primitive_state(),
depth_stencil: None,