summaryrefslogtreecommitdiff
path: root/src/main.rs
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 /src/main.rs
parent76a3a021402e05823e1f82fd592c853a4a6be563 (diff)
style: increase max struct literal width to 36
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs77
1 files changed, 13 insertions, 64 deletions
diff --git a/src/main.rs b/src/main.rs
index ad59b38..eb89fef 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -8,16 +8,9 @@ use engine::{Engine, Key, WindowSize};
use tracing::Level;
use tracing_subscriber::FmtSubscriber;
-const WINDOW_SIZE: WindowSize = WindowSize {
- width: 500,
- height: 600,
-};
+const WINDOW_SIZE: WindowSize = WindowSize { width: 500, height: 600 };
-const BLUE: Color<f32> = Color {
- red: 0.0,
- blue: 1.0,
- green: 0.0,
-};
+const BLUE: Color<f32> = Color { red: 0.0, blue: 1.0, green: 0.0 };
fn main() -> Result<(), Box<dyn Error>>
{
@@ -33,53 +26,25 @@ fn main() -> Result<(), Box<dyn Error>>
ObjectId::new(1),
&[
VertexBuilder::new()
- .pos(Vec3 {
- x: -0.5,
- y: -0.5,
- z: 0.0,
- })
- .color(Color {
- red: 1.0,
- green: 0.0,
- blue: 0.0,
- })
+ .pos(Vec3 { x: -0.5, y: -0.5, z: 0.0 })
+ .color(Color { red: 1.0, green: 0.0, blue: 0.0 })
.build()
.unwrap(),
VertexBuilder::new()
- .pos(Vec3 {
- x: 0.5,
- y: -0.5,
- z: 0.0,
- })
- .color(Color {
- red: 0.0,
- green: 1.0,
- blue: 0.0,
- })
+ .pos(Vec3 { x: 0.5, y: -0.5, z: 0.0 })
+ .color(Color { red: 0.0, green: 1.0, blue: 0.0 })
.build()
.unwrap(),
VertexBuilder::new()
- .pos(Vec3 {
- x: 0.0,
- y: 0.5,
- z: 0.0,
- })
- .color(Color {
- red: 0.0,
- green: 0.0,
- blue: 1.0,
- })
+ .pos(Vec3 { x: 0.0, y: 0.5, z: 0.0 })
+ .color(Color { red: 0.0, green: 0.0, blue: 1.0 })
.build()
.unwrap(),
],
None,
)?;
- triangle.translate(Vec3 {
- x: 0.0,
- y: 0.4,
- z: 0.0,
- });
+ triangle.translate(Vec3 { x: 0.0, y: 0.4, z: 0.0 });
engine.add_object(triangle);
@@ -87,38 +52,22 @@ fn main() -> Result<(), Box<dyn Error>>
ObjectId::new(2),
&[
VertexBuilder::new()
- .pos(Vec3 {
- x: 0.5,
- y: 0.5,
- z: 0.0,
- })
+ .pos(Vec3 { x: 0.5, y: 0.5, z: 0.0 })
.color(BLUE)
.build()
.unwrap(),
VertexBuilder::new()
- .pos(Vec3 {
- x: 0.5,
- y: -0.5,
- z: 0.0,
- })
+ .pos(Vec3 { x: 0.5, y: -0.5, z: 0.0 })
.color(BLUE)
.build()
.unwrap(),
VertexBuilder::new()
- .pos(Vec3 {
- x: -0.5,
- y: -0.5,
- z: 0.0,
- })
+ .pos(Vec3 { x: -0.5, y: -0.5, z: 0.0 })
.color(BLUE)
.build()
.unwrap(),
VertexBuilder::new()
- .pos(Vec3 {
- x: -0.5,
- y: 0.5,
- z: 0.0,
- })
+ .pos(Vec3 { x: -0.5, y: 0.5, z: 0.0 })
.color(BLUE)
.build()
.unwrap(),