From d27b8a9ad41929c9e69c3fbf96dfa394540db602 Mon Sep 17 00:00:00 2001 From: Dmitry Stepanov Date: Sat, 29 Aug 2026 10:01:35 +0300 Subject: [PATCH] fixed clippy warnings --- editor/src/ui_scene/mod.rs | 2 +- fyrox-impl/src/renderer/ssao/mod.rs | 2 +- fyrox-impl/src/resource/fbx/scene/geometry.rs | 4 ++-- fyrox-impl/src/resource/fbx/scene/mod.rs | 2 +- fyrox-impl/src/scene/mesh/buffer.rs | 2 +- fyrox-impl/src/scene/tilemap/property.rs | 1 - fyrox-impl/src/utils/raw_mesh.rs | 2 +- fyrox-texture/src/lib.rs | 2 +- fyrox-ui/src/formatted_text/run.rs | 1 - 9 files changed, 8 insertions(+), 10 deletions(-) diff --git a/editor/src/ui_scene/mod.rs b/editor/src/ui_scene/mod.rs index bb8cfbdb1..6f83f5235 100644 --- a/editor/src/ui_scene/mod.rs +++ b/editor/src/ui_scene/mod.rs @@ -457,7 +457,7 @@ impl SceneController for UiScene { self.ui .try_get_node((*handle).into()) .ok() - .map(|n| make_widget_name(n)), + .map(make_widget_name), )) .with_destination(*view) .with_direction(MessageDirection::ToWidget), diff --git a/fyrox-impl/src/renderer/ssao/mod.rs b/fyrox-impl/src/renderer/ssao/mod.rs index 92e22f34b..f7970a400 100644 --- a/fyrox-impl/src/renderer/ssao/mod.rs +++ b/fyrox-impl/src/renderer/ssao/mod.rs @@ -105,7 +105,7 @@ impl ScreenSpaceAmbientOcclusionRenderer { noise: { const RGB_PIXEL_SIZE: usize = 3; let mut pixels = [0u8; RGB_PIXEL_SIZE * NOISE_SIZE * NOISE_SIZE]; - for pixel in pixels.chunks_exact_mut(RGB_PIXEL_SIZE) { + for pixel in pixels.as_chunks_mut::().0 { pixel[0] = rng.gen_range(0u8..255u8); // R pixel[1] = rng.gen_range(0u8..255u8); // G pixel[2] = 0u8; // B diff --git a/fyrox-impl/src/resource/fbx/scene/geometry.rs b/fyrox-impl/src/resource/fbx/scene/geometry.rs index 4b4282bf6..c4ba78630 100644 --- a/fyrox-impl/src/resource/fbx/scene/geometry.rs +++ b/fyrox-impl/src/resource/fbx/scene/geometry.rs @@ -60,7 +60,7 @@ fn read_vertices( let vertices_node_handle = nodes.find(geom_node_handle, "Vertices")?; let vertices_array_node = nodes.get_by_name(vertices_node_handle, "a")?; let mut vertices = Vec::with_capacity(vertices_array_node.attrib_count() / 3); - for vertex in vertices_array_node.attributes().chunks_exact(3) { + for vertex in vertices_array_node.attributes().as_chunks::<3>().0 { vertices.push(Vector3::new( vertex[0].as_f32()?, vertex[1].as_f32()?, @@ -141,7 +141,7 @@ fn read_uvs( "UV", |attributes| { let mut uvs = Vec::with_capacity(attributes.len() / 2); - for uv in attributes.chunks_exact(2) { + for uv in attributes.as_chunks::<2>().0 { uvs.push(Vector2::new(uv[0].as_f32()?, uv[1].as_f32()?)); } Ok(uvs) diff --git a/fyrox-impl/src/resource/fbx/scene/mod.rs b/fyrox-impl/src/resource/fbx/scene/mod.rs index e73968cee..b46c8ebbf 100644 --- a/fyrox-impl/src/resource/fbx/scene/mod.rs +++ b/fyrox-impl/src/resource/fbx/scene/mod.rs @@ -587,7 +587,7 @@ pub fn attributes_to_vec3_array( attributes: &[FbxAttribute], ) -> Result>, FbxError> { let mut out_container = Vec::with_capacity(attributes.len() / 3); - for chunk in attributes.chunks_exact(3) { + for chunk in attributes.as_chunks::<3>().0 { out_container.push(Vector3::new( chunk[0].as_f32()?, chunk[1].as_f32()?, diff --git a/fyrox-impl/src/scene/mesh/buffer.rs b/fyrox-impl/src/scene/mesh/buffer.rs index ca89e5bd3..2e924e9f8 100644 --- a/fyrox-impl/src/scene/mesh/buffer.rs +++ b/fyrox-impl/src/scene/mesh/buffer.rs @@ -1053,7 +1053,7 @@ impl VertexBuffer { /// Finds free location for an attribute in the layout. pub fn find_free_shader_location(&self) -> u8 { let mut location = None; - for attribute in self.dense_layout.chunks_exact(2) { + for attribute in self.dense_layout.as_chunks::<2>().0 { let left = &attribute[0]; let right = &attribute[1]; diff --git a/fyrox-impl/src/scene/tilemap/property.rs b/fyrox-impl/src/scene/tilemap/property.rs index b15201570..b302636be 100644 --- a/fyrox-impl/src/scene/tilemap/property.rs +++ b/fyrox-impl/src/scene/tilemap/property.rs @@ -41,7 +41,6 @@ use crate::core::{ use std::fmt::{Debug, Display, Formatter}; use super::*; -use tileset::*; /// Trait for objects that identify a tile set property of a particular type. pub trait TileSetPropertyId { diff --git a/fyrox-impl/src/utils/raw_mesh.rs b/fyrox-impl/src/utils/raw_mesh.rs index 58e3ae029..14469cdc4 100644 --- a/fyrox-impl/src/utils/raw_mesh.rs +++ b/fyrox-impl/src/utils/raw_mesh.rs @@ -177,7 +177,7 @@ where vertices: vertices.into_iter().map(|w| w.vertex).collect(), triangles: self .indices - .chunks_exact(3) + .as_chunks::<3>().0.iter() .map(|i| TriangleDefinition([i[0], i[1], i[2]])) .collect(), } diff --git a/fyrox-texture/src/lib.rs b/fyrox-texture/src/lib.rs index 8999c3560..e1b5b3cfa 100644 --- a/fyrox-texture/src/lib.rs +++ b/fyrox-texture/src/lib.rs @@ -1532,7 +1532,7 @@ impl Texture { D3DFormat::G16R16 => { // GR16 -> RG16 assert_eq!(bytes.len() % 4, 0); - for chunk in bytes.chunks_exact_mut(4) { + for chunk in bytes.as_chunks_mut::<4>().0 { // Red Hi + Lo bytes let gh = chunk[0]; let gl = chunk[1]; diff --git a/fyrox-ui/src/formatted_text/run.rs b/fyrox-ui/src/formatted_text/run.rs index d64295cb1..ffa3a0eb9 100644 --- a/fyrox-ui/src/formatted_text/run.rs +++ b/fyrox-ui/src/formatted_text/run.rs @@ -18,7 +18,6 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. -use crate::core::reflect::prelude::*; use crate::font::FontHeight; use std::ops::{Deref, DerefMut};