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/effects.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'stockton-levels/src/q3/effects.rs') diff --git a/stockton-levels/src/q3/effects.rs b/stockton-levels/src/q3/effects.rs index 77ad1ed..a796570 100644 --- a/stockton-levels/src/q3/effects.rs +++ b/stockton-levels/src/q3/effects.rs @@ -17,11 +17,11 @@ use std::str; -use crate::helpers::slice_to_u32; -use crate::types::{Result, ParseError}; -use crate::traits::effects::*; use super::Q3BSPFile; use crate::coords::CoordSystem; +use crate::helpers::slice_to_u32; +use crate::traits::effects::*; +use crate::types::{ParseError, Result}; /// The size of one effect definition const EFFECT_SIZE: usize = 64 + 4 + 4; @@ -42,23 +42,24 @@ pub fn from_data(data: &[u8], n_brushes: u32) -> Result> { } effects.push(Effect { - name: str::from_utf8(&raw[..64]).map_err(|_| ParseError::Invalid)?.to_owned(), - brush_idx + name: str::from_utf8(&raw[..64]) + .map_err(|_| ParseError::Invalid)? + .to_owned(), + brush_idx, }); } Ok(effects.into_boxed_slice()) } - impl HasEffects for Q3BSPFile { type EffectsIter<'a> = std::slice::Iter<'a, Effect>; - fn effects_iter<'a>(&'a self) -> Self::EffectsIter<'a> { + fn effects_iter(&self) -> Self::EffectsIter<'_> { self.effects.iter() } - fn get_effect<'a>(&'a self, index: u32) -> &'a Effect { + fn get_effect(&self, index: u32) -> &Effect { &self.effects[index as usize] } } -- cgit v1.2.3