summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2023-10-26 21:05:34 +0200
committerHampusM <hampus@hampusmat.com>2023-10-26 21:05:34 +0200
commiteab619bd5cfc520d3962097d16582eae6977d6dc (patch)
treec5a6ab322f33d452733bac233c631eb6a4fbcef9 /engine
parent76a3a021402e05823e1f82fd592c853a4a6be563 (diff)
style: increase max struct literal width to 36
Diffstat (limited to 'engine')
-rw-r--r--engine/src/camera.rs13
-rw-r--r--engine/src/object.rs6
-rw-r--r--engine/src/opengl/currently_bound.rs4
-rw-r--r--engine/src/transform.rs6
-rw-r--r--engine/src/vector.rs6
-rw-r--r--engine/src/vertex.rs5
6 files changed, 8 insertions, 32 deletions
diff --git a/engine/src/camera.rs b/engine/src/camera.rs
index 9ab95e7..fab92f5 100644
--- a/engine/src/camera.rs
+++ b/engine/src/camera.rs
@@ -83,16 +83,9 @@ impl Camera
pub(crate) fn new() -> Self
{
- let position = Vec3 {
- x: 0.0,
- y: 0.0,
- z: 3.0,
- };
-
- Self {
- position,
- target: Vec3::default(),
- }
+ let position = Vec3 { x: 0.0, y: 0.0, z: 3.0 };
+
+ Self { position, target: Vec3::default() }
}
pub(crate) fn as_matrix(&self) -> Matrix<f32, 4, 4>
diff --git a/engine/src/object.rs b/engine/src/object.rs
index 9952c5f..dffd240 100644
--- a/engine/src/object.rs
+++ b/engine/src/object.rs
@@ -62,11 +62,7 @@ impl Object
let transform = Transform::new();
- Ok(Self {
- id,
- renderable,
- transform,
- })
+ Ok(Self { id, renderable, transform })
}
/// Returns the object ID.
diff --git a/engine/src/opengl/currently_bound.rs b/engine/src/opengl/currently_bound.rs
index eefa239..be01841 100644
--- a/engine/src/opengl/currently_bound.rs
+++ b/engine/src/opengl/currently_bound.rs
@@ -15,8 +15,6 @@ impl<'token, Object> CurrentlyBound<'token, Object>
#[must_use]
pub unsafe fn new() -> Self
{
- Self {
- _token: PhantomData,
- }
+ Self { _token: PhantomData }
}
}
diff --git a/engine/src/transform.rs b/engine/src/transform.rs
index c216fdd..b01e3c1 100644
--- a/engine/src/transform.rs
+++ b/engine/src/transform.rs
@@ -14,11 +14,7 @@ impl Transform
{
Self {
translation: Vec3::default(),
- scaling: Vec3 {
- x: 1.0,
- y: 1.0,
- z: 1.0,
- },
+ scaling: Vec3 { x: 1.0, y: 1.0, z: 1.0 },
}
}
diff --git a/engine/src/vector.rs b/engine/src/vector.rs
index e8d51d2..00b2ea5 100644
--- a/engine/src/vector.rs
+++ b/engine/src/vector.rs
@@ -23,11 +23,7 @@ pub struct Vec3<Value>
impl Vec3<f32>
{
- pub const UP: Self = Self {
- x: 0.0,
- y: 1.0,
- z: 0.0,
- };
+ pub const UP: Self = Self { x: 0.0, y: 1.0, z: 0.0 };
/// Returns the length of the vector.
#[must_use]
diff --git a/engine/src/vertex.rs b/engine/src/vertex.rs
index e03eacb..592353a 100644
--- a/engine/src/vertex.rs
+++ b/engine/src/vertex.rs
@@ -23,10 +23,7 @@ impl Builder
#[must_use]
pub fn new() -> Self
{
- Self {
- pos: None,
- color: None,
- }
+ Self { pos: None, color: None }
}
#[must_use]