mirror of
https://codeberg.org/icewind/vbsp.git
synced 2026-06-03 18:54:05 +02:00
clippy fixes
This commit is contained in:
parent
f808d67303
commit
ea557f08d3
4 changed files with 6 additions and 6 deletions
|
|
@ -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))?;
|
||||
.ok_or(BspError::LumpOutOfBounds(*lump))?;
|
||||
|
||||
Ok(match lump.ident {
|
||||
0 => Cow::Borrowed(raw_data),
|
||||
|
|
|
|||
|
|
@ -138,10 +138,10 @@ where
|
|||
[T; N]: Default,
|
||||
{
|
||||
fn parse(raw: &'_ str) -> Result<Self, EntityParseError> {
|
||||
let mut values = raw.split(" ").map(T::from_str);
|
||||
let mut values = raw.split(' ').map(T::from_str);
|
||||
let mut result = <[T; N]>::default();
|
||||
for i in 0..N {
|
||||
result[i] = values.next().ok_or(EntityParseError::ElementCount)??;
|
||||
for item in result.iter_mut() {
|
||||
*item = values.next().ok_or(EntityParseError::ElementCount)??;
|
||||
}
|
||||
Ok(result)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ impl FromStr for Vector {
|
|||
type Err = EntityParseError;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
let mut floats = s.split(" ").map(f32::from_str);
|
||||
let mut floats = s.split(' ').map(f32::from_str);
|
||||
let x = floats.next().ok_or(EntityParseError::ElementCount)??;
|
||||
let y = floats.next().ok_or(EntityParseError::ElementCount)??;
|
||||
let z = floats.next().ok_or(EntityParseError::ElementCount)??;
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ impl<'a> Handle<'a, DisplacementInfo> {
|
|||
.unwrap();
|
||||
|
||||
corner_positions.rotate_left(start_index);
|
||||
corner_positions.try_into().unwrap()
|
||||
corner_positions
|
||||
}
|
||||
|
||||
fn subdivided_face(&self) -> impl Iterator<Item = Vector> + 'a {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue