diff options
author | 2023-09-20 05:19:24 +0200 | |
---|---|---|
committer | 2023-09-20 05:19:24 +0200 | |
commit | 14ba939e674ec4d9ca53b506ffa3259d30216e85 (patch) | |
tree | af569774bbb20cb953f9ab2e4632216577e7e59a | |
parent | 1e4bade53aaaeb17542d0372ac827bcb7daf037c (diff) | |
download | iced-14ba939e674ec4d9ca53b506ffa3259d30216e85.tar.gz iced-14ba939e674ec4d9ca53b506ffa3259d30216e85.tar.bz2 iced-14ba939e674ec4d9ca53b506ffa3259d30216e85.zip |
Fix `clippy::unreadable_literal`
-rw-r--r-- | .cargo/config.toml | 9 | ||||
-rw-r--r-- | tiny_skia/src/vector.rs | 6 | ||||
-rw-r--r-- | wgpu/src/triangle.rs | 10 |
3 files changed, 15 insertions, 10 deletions
diff --git a/.cargo/config.toml b/.cargo/config.toml index 61bfbf17..4ae09897 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -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 """ diff --git a/tiny_skia/src/vector.rs b/tiny_skia/src/vector.rs index 490b9f69..a1cd269d 100644 --- a/tiny_skia/src/vector.rs +++ b/tiny_skia/src/vector.rs @@ -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); } } diff --git a/wgpu/src/triangle.rs b/wgpu/src/triangle.rs index 7e1bd9cc..f8014ceb 100644 --- a/wgpu/src/triangle.rs +++ b/wgpu/src/triangle.rs @@ -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, |