1
0
Fork 0
mirror of https://codeberg.org/icewind/vbsp.git synced 2026-06-03 18:54:05 +02:00

clippy fixes

This commit is contained in:
Robin Appelman 2022-02-18 17:22:27 +01:00
commit 3cdb50636d
3 changed files with 6 additions and 6 deletions

View file

@ -52,7 +52,7 @@ impl<'a> BspFile<'a> {
let raw_data = self
.data
.get(lump.offset as usize..lump.offset as usize + lump.length as usize)
.ok_or_else(|| BspError::LumpOutOfBounds(lump.clone()))?;
.ok_or_else(|| BspError::LumpOutOfBounds(*lump))?;
Ok(match lump.ident {
0 => Cow::Borrowed(raw_data),

View file

@ -135,7 +135,7 @@ impl<'a> Entity<'a> {
}
}
Iter { buf: &self.buf }
Iter { buf: self.buf }
}
}

View file

@ -29,8 +29,8 @@ impl<T> Clone for Handle<'_, T> {
}
}
impl<'a, T> Handle<'a, T> {
pub fn as_ref(&self) -> &'a T {
impl<'a, T> AsRef<T> for Handle<'a, T> {
fn as_ref(&self) -> &'a T {
self.data
}
}
@ -105,7 +105,7 @@ impl<'a> IntoIterator for &'a Leaves {
type Item = &'a Leaf;
fn into_iter(self) -> Self::IntoIter {
(&self.leaves[..]).into_iter()
(&self.leaves[..]).iter()
}
}
@ -114,7 +114,7 @@ impl<'a> IntoIterator for &'a mut Leaves {
type Item = &'a mut Leaf;
fn into_iter(self) -> Self::IntoIter {
(&mut self.leaves[..]).into_iter()
self.leaves.iter_mut()
}
}