From 770059c5392ac7f174895ead5a71fa2bd0f8041b Mon Sep 17 00:00:00 2001 From: Rob Parrett Date: Mon, 17 Mar 2025 11:00:27 -0700 Subject: [PATCH] Fix clippy lints on Rust beta (#18361) # Objective Fixes #18360 ## Solution ``` rustup toolchain install beta rustup default beta cargo run -p ci ``` Make suggested changes ## Testing `cargo run -p ci` --- crates/bevy_pbr/src/material_bind_groups.rs | 26 ++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/crates/bevy_pbr/src/material_bind_groups.rs b/crates/bevy_pbr/src/material_bind_groups.rs index 0ce744b070..28ed7c5213 100644 --- a/crates/bevy_pbr/src/material_bind_groups.rs +++ b/crates/bevy_pbr/src/material_bind_groups.rs @@ -1372,10 +1372,10 @@ where } if let Some(required_binding_array_size) = required_binding_array_size { - sampler_bindings.extend( - iter::repeat(&**fallback_sampler) - .take(required_binding_array_size as usize - sampler_bindings.len()), - ); + sampler_bindings.extend(iter::repeat_n( + &**fallback_sampler, + required_binding_array_size as usize - sampler_bindings.len(), + )); } let binding_number = bindless_resource_type @@ -1436,10 +1436,10 @@ where } if let Some(required_binding_array_size) = required_binding_array_size { - texture_bindings.extend( - iter::repeat(&*fallback_image.texture_view) - .take(required_binding_array_size as usize - texture_bindings.len()), - ); + texture_bindings.extend(iter::repeat_n( + &*fallback_image.texture_view, + required_binding_array_size as usize - texture_bindings.len(), + )); } binding_resource_arrays.push(( @@ -1489,14 +1489,14 @@ where .collect(); if let Some(required_binding_array_size) = required_binding_array_size { - buffer_bindings.extend( - iter::repeat(BufferBinding { + buffer_bindings.extend(iter::repeat_n( + BufferBinding { buffer: fallback_buffer, offset: 0, size: None, - }) - .take(required_binding_array_size as usize - buffer_bindings.len()), - ); + }, + required_binding_array_size as usize - buffer_bindings.len(), + )); } binding_resource_arrays.push((