diff options
| author | HampusM <hampus@hampusmat.com> | 2026-09-22 18:22:46 +0200 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-09-22 18:22:46 +0200 |
| commit | c73ab25c9dbe40284cfd38beaf31e2a20a9810de (patch) | |
| tree | 51c5817a0c252a172c03a47e36886e563a4e623d /engine/src/data_types | |
| parent | 2ccda0cd5f81909fddc74d95f960f781a64bcae1 (diff) | |
refactor(engine): fix portion of clippy lints
Diffstat (limited to 'engine/src/data_types')
| -rw-r--r-- | engine/src/data_types/matrix.rs | 9 | ||||
| -rw-r--r-- | engine/src/data_types/vector.rs | 1 |
2 files changed, 6 insertions, 4 deletions
diff --git a/engine/src/data_types/matrix.rs b/engine/src/data_types/matrix.rs index 9ab5bd4..149f0dc 100644 --- a/engine/src/data_types/matrix.rs +++ b/engine/src/data_types/matrix.rs @@ -43,7 +43,7 @@ impl<Value, const ROWS: usize, const COLUMNS: usize> Matrix<Value, ROWS, COLUMNS where Row: Into<[Value; COLUMNS]>, { - let items = rows.map(|row| row.into()); + let items = rows.map(Into::into); Self { items } } @@ -59,7 +59,7 @@ impl<Value, const ROWS: usize, const COLUMNS: usize> Matrix<Value, ROWS, COLUMNS pub fn items(&self) -> &[Value] { - &self.items.as_flattened() + self.items.as_flattened() } pub fn to_column_major(&self) -> [[Value; ROWS]; COLUMNS] @@ -160,6 +160,7 @@ impl Matrix<f32, 4, 4> self[CellPos { row: 3, col: 3 }] = 1.0; } + #[must_use] pub fn inverse(&self) -> Self { let coef_00 = self[CellPos { row: 2, col: 2 }] * self[CellPos { row: 3, col: 3 }] @@ -411,7 +412,7 @@ where fn mul(self, rhs: Vec3<Value>) -> Self::Output { - self * &rhs + <Self as Mul<&Vec3<Value>>>::mul(self, &rhs) } } @@ -463,7 +464,7 @@ where fn mul(self, rhs: Vec4<Value>) -> Self::Output { - self * &rhs + <Self as Mul<&Vec4<Value>>>::mul(self, &rhs) } } diff --git a/engine/src/data_types/vector.rs b/engine/src/data_types/vector.rs index 915599a..106f215 100644 --- a/engine/src/data_types/vector.rs +++ b/engine/src/data_types/vector.rs @@ -187,6 +187,7 @@ impl Vec3<f32> .normalize() } + #[must_use] pub fn into_deg_angles(self) -> Angles<f32> { let Self { x, y, z } = self.normalize(); |
