fixed clippy warnings

This commit is contained in:
Dmitry Stepanov
2026-08-29 10:01:35 +03:00
parent 4b82b4934a
commit d27b8a9ad4
9 changed files with 8 additions and 10 deletions
+1 -1
View File
@@ -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),
+1 -1
View File
@@ -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::<RGB_PIXEL_SIZE>().0 {
pixel[0] = rng.gen_range(0u8..255u8); // R
pixel[1] = rng.gen_range(0u8..255u8); // G
pixel[2] = 0u8; // B
@@ -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)
+1 -1
View File
@@ -587,7 +587,7 @@ pub fn attributes_to_vec3_array(
attributes: &[FbxAttribute],
) -> Result<Vec<Vector3<f32>>, 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()?,
+1 -1
View File
@@ -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];
-1
View File
@@ -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 {
+1 -1
View File
@@ -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(),
}
+1 -1
View File
@@ -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];
-1
View File
@@ -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};