From 15f794b7a89efb3299cb85b392ec13af145fb0fd Mon Sep 17 00:00:00 2001 From: Poly Date: Mon, 4 Jul 2022 01:17:29 +0200 Subject: Address Clippy lints --- glow/src/quad/compatibility.rs | 10 ++++------ glow/src/quad/core.rs | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'glow/src/quad') diff --git a/glow/src/quad/compatibility.rs b/glow/src/quad/compatibility.rs index 76f98ab7..7224e206 100644 --- a/glow/src/quad/compatibility.rs +++ b/glow/src/quad/compatibility.rs @@ -110,10 +110,8 @@ impl Pipeline { bounds: Rectangle, ) { // TODO: Remove this allocation (probably by changing the shader and removing the need of two `position`) - let vertices: Vec = instances - .iter() - .flat_map(|quad| Vertex::from_quad(quad)) - .collect(); + let vertices: Vec = + instances.iter().flat_map(Vertex::from_quad).collect(); // TODO: Remove this allocation (or allocate only when needed) let indices: Vec = (0..instances.len().min(MAX_QUADS) as i32) @@ -187,13 +185,13 @@ impl Pipeline { gl.buffer_sub_data_u8_slice( glow::ARRAY_BUFFER, 0, - bytemuck::cast_slice(&vertices), + bytemuck::cast_slice(vertices), ); gl.buffer_sub_data_u8_slice( glow::ELEMENT_ARRAY_BUFFER, 0, - bytemuck::cast_slice(&indices), + bytemuck::cast_slice(indices), ); gl.draw_elements( diff --git a/glow/src/quad/core.rs b/glow/src/quad/core.rs index f37300f6..3e51b1ca 100644 --- a/glow/src/quad/core.rs +++ b/glow/src/quad/core.rs @@ -154,7 +154,7 @@ impl Pipeline { gl.buffer_sub_data_u8_slice( glow::ARRAY_BUFFER, 0, - bytemuck::cast_slice(&instances), + bytemuck::cast_slice(instances), ); gl.draw_arrays_instanced( -- cgit From 2065a40f642589134142a740ff4198deaa4c378b Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 9 Jul 2022 18:42:41 +0200 Subject: Fix `clippy` lints for all crates and features ... and check those in CI as well! --- glow/src/quad/compatibility.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'glow/src/quad') diff --git a/glow/src/quad/compatibility.rs b/glow/src/quad/compatibility.rs index 7224e206..eb3fb7e0 100644 --- a/glow/src/quad/compatibility.rs +++ b/glow/src/quad/compatibility.rs @@ -116,14 +116,7 @@ impl Pipeline { // TODO: Remove this allocation (or allocate only when needed) let indices: Vec = (0..instances.len().min(MAX_QUADS) as i32) .flat_map(|i| { - [ - 0 + i * 4, - 1 + i * 4, - 2 + i * 4, - 2 + i * 4, - 1 + i * 4, - 3 + i * 4, - ] + [i * 4, 1 + i * 4, 2 + i * 4, 2 + i * 4, 1 + i * 4, 3 + i * 4] }) .cycle() .take(instances.len() * 6) -- cgit