From 2111c1248b08236a839dcf22036f92735bceb31c Mon Sep 17 00:00:00 2001 From: tcmal Date: Sun, 25 Aug 2024 17:44:21 +0100 Subject: chore(all): style formatting and clippy fixes --- stockton-levels/src/q3/vertices.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'stockton-levels/src/q3/vertices.rs') diff --git a/stockton-levels/src/q3/vertices.rs b/stockton-levels/src/q3/vertices.rs index d517ede..649d0d5 100644 --- a/stockton-levels/src/q3/vertices.rs +++ b/stockton-levels/src/q3/vertices.rs @@ -18,10 +18,10 @@ use std::convert::TryInto; use super::Q3BSPFile; +use crate::coords::CoordSystem; use crate::helpers::{slice_to_u32, slice_to_vec3}; -use crate::types::{Result, ParseError, RGBA}; use crate::traits::vertices::*; -use crate::coords::CoordSystem; +use crate::types::{ParseError, Result, RGBA}; /// The size of one vertex const VERTEX_SIZE: usize = (4 * 3) + (2 * 2 * 4) + (4 * 3) + 4; @@ -56,7 +56,6 @@ pub fn meshverts_from_data(data: &[u8]) -> Result> { } let length = data.len() / 4; - let mut meshverts = Vec::with_capacity(length as usize); for n in 0..length { meshverts.push(slice_to_u32(&data[n * 4..(n + 1) * 4])) @@ -68,11 +67,11 @@ pub fn meshverts_from_data(data: &[u8]) -> Result> { impl HasVertices for Q3BSPFile { type VerticesIter<'a> = std::slice::Iter<'a, Vertex>; - fn vertices_iter<'a>(&'a self) -> Self::VerticesIter<'a> { + fn vertices_iter(&self) -> Self::VerticesIter<'_> { self.vertices.iter() } - fn get_vertex<'a>(&'a self, index: u32) -> &'a Vertex { + fn get_vertex(&self, index: u32) -> &Vertex { &self.vertices[index as usize] } } @@ -80,11 +79,11 @@ impl HasVertices for Q3BSPFile { impl HasMeshVerts for Q3BSPFile { type MeshVertsIter<'a> = std::slice::Iter<'a, MeshVert>; - fn meshverts_iter<'a>(&'a self) -> Self::MeshVertsIter<'a> { + fn meshverts_iter(&self) -> Self::MeshVertsIter<'_> { self.meshverts.iter() } fn get_meshvert<'a>(&self, index: u32) -> MeshVert { self.meshverts[index as usize] } -} \ No newline at end of file +} -- cgit v1.2.3