Skip to content

Commit 4420139

Browse files
committed
fix lint warnings
1 parent 1fb9d90 commit 4420139

5 files changed

Lines changed: 22 additions & 28 deletions

File tree

crates/processing_ffi/src/lib.rs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3005,63 +3005,57 @@ pub extern "C" fn processing_filter_set_passes(filter_id: u64, passes: u32) {
30053005
#[unsafe(no_mangle)]
30063006
pub extern "C" fn processing_filter_blur() -> u64 {
30073007
error::clear_error();
3008-
error::check(|| filter_blur())
3009-
.map(|e| e.to_bits())
3010-
.unwrap_or(0)
3008+
error::check(filter_blur).map(|e| e.to_bits()).unwrap_or(0)
30113009
}
30123010

30133011
#[unsafe(no_mangle)]
30143012
pub extern "C" fn processing_filter_invert() -> u64 {
30153013
error::clear_error();
3016-
error::check(|| filter_invert())
3014+
error::check(filter_invert)
30173015
.map(|e| e.to_bits())
30183016
.unwrap_or(0)
30193017
}
30203018

30213019
#[unsafe(no_mangle)]
30223020
pub extern "C" fn processing_filter_gray() -> u64 {
30233021
error::clear_error();
3024-
error::check(|| filter_gray())
3025-
.map(|e| e.to_bits())
3026-
.unwrap_or(0)
3022+
error::check(filter_gray).map(|e| e.to_bits()).unwrap_or(0)
30273023
}
30283024

30293025
#[unsafe(no_mangle)]
30303026
pub extern "C" fn processing_filter_threshold() -> u64 {
30313027
error::clear_error();
3032-
error::check(|| filter_threshold())
3028+
error::check(filter_threshold)
30333029
.map(|e| e.to_bits())
30343030
.unwrap_or(0)
30353031
}
30363032

30373033
#[unsafe(no_mangle)]
30383034
pub extern "C" fn processing_filter_posterize() -> u64 {
30393035
error::clear_error();
3040-
error::check(|| filter_posterize())
3036+
error::check(filter_posterize)
30413037
.map(|e| e.to_bits())
30423038
.unwrap_or(0)
30433039
}
30443040

30453041
#[unsafe(no_mangle)]
30463042
pub extern "C" fn processing_filter_opaque() -> u64 {
30473043
error::clear_error();
3048-
error::check(|| filter_opaque())
3044+
error::check(filter_opaque)
30493045
.map(|e| e.to_bits())
30503046
.unwrap_or(0)
30513047
}
30523048

30533049
#[unsafe(no_mangle)]
30543050
pub extern "C" fn processing_filter_erode() -> u64 {
30553051
error::clear_error();
3056-
error::check(|| filter_erode())
3057-
.map(|e| e.to_bits())
3058-
.unwrap_or(0)
3052+
error::check(filter_erode).map(|e| e.to_bits()).unwrap_or(0)
30593053
}
30603054

30613055
#[unsafe(no_mangle)]
30623056
pub extern "C" fn processing_filter_dilate() -> u64 {
30633057
error::clear_error();
3064-
error::check(|| filter_dilate())
3058+
error::check(filter_dilate)
30653059
.map(|e| e.to_bits())
30663060
.unwrap_or(0)
30673061
}

crates/processing_render/src/graphics.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,10 +463,10 @@ pub fn set_bloom(
463463

464464
commands.entity(entity).insert((bloom, Hdr));
465465

466-
if let Ok(mut tm) = tonemapping_query.get_mut(entity) {
467-
if *tm == Tonemapping::None {
468-
*tm = Tonemapping::TonyMcMapface;
469-
}
466+
if let Ok(mut tm) = tonemapping_query.get_mut(entity)
467+
&& *tm == Tonemapping::None
468+
{
469+
*tm = Tonemapping::TonyMcMapface;
470470
}
471471

472472
Ok(())

crates/processing_render/src/particles/point_render.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ impl Specializer<RenderPipeline> for RasterSpecializer {
141141
target.format = key.format;
142142
target.blend = key.blend;
143143
}
144-
if key.blend.is_some() {
145-
if let Some(depth) = descriptor.depth_stencil.as_mut() {
146-
depth.depth_write_enabled = Some(false);
147-
}
144+
if key.blend.is_some()
145+
&& let Some(depth) = descriptor.depth_stencil.as_mut()
146+
{
147+
depth.depth_write_enabled = Some(false);
148148
}
149149
Ok(key)
150150
}

crates/processing_render/src/particles/scatter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ fn extract_scatter_geometry(mesh: &mut Mesh) -> Result<(Vec<[f32; 3]>, Vec<u32>)
101101
}
102102
};
103103

104-
if dense_indices.len() % 3 != 0 {
104+
if !dense_indices.len().is_multiple_of(3) {
105105
return Err(ProcessingError::InvalidArgument(
106106
"scatter source mesh has a non-triangle index list".to_string(),
107107
));

crates/processing_render/src/render/primitive/shape.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ pub fn build_direct_fill(mesh: &mut Mesh, builder: &ShapeBuilder, color: Color)
245245

246246
match builder.kind {
247247
ShapeKind::Triangles => {
248-
for chunk in vertices.chunks_exact(3) {
248+
for chunk in vertices.as_chunks::<3>().0 {
249249
push_triangle(
250250
mesh, color, chunk[0].0, chunk[0].1, chunk[1].0, chunk[1].1, chunk[2].0,
251251
chunk[2].1,
@@ -296,7 +296,7 @@ pub fn build_direct_fill(mesh: &mut Mesh, builder: &ShapeBuilder, color: Color)
296296
}
297297
}
298298
ShapeKind::Quads => {
299-
for chunk in vertices.chunks_exact(4) {
299+
for chunk in vertices.as_chunks::<4>().0 {
300300
push_quad(
301301
mesh, color, chunk[0].0, chunk[0].1, chunk[1].0, chunk[1].1, chunk[2].0,
302302
chunk[2].1, chunk[3].0, chunk[3].1,
@@ -344,7 +344,7 @@ pub fn build_direct_stroke(
344344

345345
match builder.kind {
346346
ShapeKind::Lines => {
347-
for chunk in vertices.chunks_exact(2) {
347+
for chunk in vertices.as_chunks::<2>().0 {
348348
let mut pb = Path::builder();
349349
pb.begin(Point::new(chunk[0].0, chunk[0].1));
350350
pb.line_to(Point::new(chunk[1].0, chunk[1].1));
@@ -359,7 +359,7 @@ pub fn build_direct_stroke(
359359
}
360360
}
361361
ShapeKind::Triangles => {
362-
for chunk in vertices.chunks_exact(3) {
362+
for chunk in vertices.as_chunks::<3>().0 {
363363
stroke_polygon(
364364
mesh,
365365
&[chunk[0], chunk[1], chunk[2]],
@@ -407,7 +407,7 @@ pub fn build_direct_stroke(
407407
}
408408
}
409409
ShapeKind::Quads => {
410-
for chunk in vertices.chunks_exact(4) {
410+
for chunk in vertices.as_chunks::<4>().0 {
411411
stroke_polygon(
412412
mesh,
413413
&[chunk[0], chunk[1], chunk[2], chunk[3]],

0 commit comments

Comments
 (0)