Skip to content

Commit b5e5db7

Browse files
committed
More better rust.
1 parent e865f8f commit b5e5db7

29 files changed

+396
-268
lines changed

shaders/src/shaders/a_lot_of_spheres.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ pub const SHADER_DEFINITION: ShaderDefinition = ShaderDefinition {
1919

2020
pub fn shader_fn(render_instruction: &ShaderInput, render_result: &mut ShaderResult) {
2121
let color = &mut render_result.color;
22-
let (resolution, time, frag_coord) = (
23-
render_instruction.resolution,
24-
render_instruction.time,
25-
render_instruction.frag_coord,
26-
);
22+
let &ShaderInput {
23+
resolution,
24+
time,
25+
frag_coord,
26+
..
27+
} = render_instruction;
2728
Inputs { resolution, time }.main_image(color, frag_coord)
2829
}
2930

shaders/src/shaders/a_question_of_time.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ pub const SHADER_DEFINITION: ShaderDefinition = ShaderDefinition {
3434

3535
pub fn shader_fn(render_instruction: &ShaderInput, render_result: &mut ShaderResult) {
3636
let color = &mut render_result.color;
37-
let (resolution, time, frag_coord, mouse) = (
38-
render_instruction.resolution,
39-
render_instruction.time,
40-
render_instruction.frag_coord,
41-
render_instruction.mouse,
42-
);
37+
let &ShaderInput {
38+
resolution,
39+
time,
40+
frag_coord,
41+
mouse,
42+
..
43+
} = render_instruction;
4344
Inputs {
4445
resolution,
4546
time,

shaders/src/shaders/apollonian.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ pub const SHADER_DEFINITION: ShaderDefinition = ShaderDefinition {
1818

1919
pub fn shader_fn(render_instruction: &ShaderInput, render_result: &mut ShaderResult) {
2020
let color = &mut render_result.color;
21-
let (resolution, time, frag_coord, mouse) = (
22-
render_instruction.resolution,
23-
render_instruction.time,
24-
render_instruction.frag_coord,
25-
render_instruction.mouse,
26-
);
21+
let &ShaderInput {
22+
resolution,
23+
time,
24+
frag_coord,
25+
mouse,
26+
..
27+
} = render_instruction;
2728
State::new(Inputs {
2829
resolution,
2930
time,

shaders/src/shaders/atmosphere_system_test.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ pub const SHADER_DEFINITION: ShaderDefinition = ShaderDefinition {
1818

1919
pub fn shader_fn(render_instruction: &ShaderInput, render_result: &mut ShaderResult) {
2020
let color = &mut render_result.color;
21-
let (resolution, time, frag_coord, mouse) = (
22-
render_instruction.resolution,
23-
render_instruction.time,
24-
render_instruction.frag_coord,
25-
render_instruction.mouse,
26-
);
21+
let &ShaderInput {
22+
resolution,
23+
time,
24+
frag_coord,
25+
mouse,
26+
..
27+
} = render_instruction;
2728
State::new(Inputs {
2829
resolution,
2930
time,

shaders/src/shaders/bubble_buckey_balls.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@ pub const SHADER_DEFINITION: ShaderDefinition = ShaderDefinition {
1616

1717
pub fn shader_fn(render_instruction: &ShaderInput, render_result: &mut ShaderResult) {
1818
let color = &mut render_result.color;
19-
let (resolution, time, frag_coord, mouse) = (
20-
render_instruction.resolution,
21-
render_instruction.time,
22-
render_instruction.frag_coord,
23-
render_instruction.mouse,
24-
);
19+
let &ShaderInput {
20+
resolution,
21+
time,
22+
frag_coord,
23+
mouse,
24+
..
25+
} = render_instruction;
2526
State::new(Inputs {
2627
resolution,
2728
time,

shaders/src/shaders/clouds.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ pub const SHADER_DEFINITION: ShaderDefinition = ShaderDefinition { name: "Clouds
66

77
pub fn shader_fn(render_instruction: &ShaderInput, render_result: &mut ShaderResult) {
88
let color = &mut render_result.color;
9-
let (resolution, time, frag_coord) = (
10-
render_instruction.resolution,
11-
render_instruction.time,
12-
render_instruction.frag_coord,
13-
);
9+
let &ShaderInput {
10+
resolution,
11+
time,
12+
frag_coord,
13+
..
14+
} = render_instruction;
1415
Inputs { resolution, time }.main_image(color, frag_coord)
1516
}
1617

shaders/src/shaders/filtering_procedurals.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@ pub const SHADER_DEFINITION: ShaderDefinition = ShaderDefinition {
2727

2828
pub fn shader_fn(render_instruction: &ShaderInput, render_result: &mut ShaderResult) {
2929
let color = &mut render_result.color;
30-
let (resolution, time, frag_coord, mouse) = (
31-
render_instruction.resolution,
32-
render_instruction.time,
33-
render_instruction.frag_coord,
34-
render_instruction.mouse,
35-
);
30+
let &ShaderInput {
31+
resolution,
32+
time,
33+
frag_coord,
34+
mouse,
35+
..
36+
} = render_instruction;
3637
Inputs {
3738
resolution,
3839
time,

shaders/src/shaders/flappy_bird.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ pub const SHADER_DEFINITION: ShaderDefinition = ShaderDefinition {
1616

1717
pub fn shader_fn(render_instruction: &ShaderInput, render_result: &mut ShaderResult) {
1818
let color = &mut render_result.color;
19-
let (resolution, time, frag_coord) = (
20-
render_instruction.resolution,
21-
render_instruction.time,
22-
render_instruction.frag_coord,
23-
);
19+
let &ShaderInput {
20+
resolution,
21+
time,
22+
frag_coord,
23+
..
24+
} = render_instruction;
2425
State::new(Inputs { resolution, time }).main_image(color, frag_coord)
2526
}
2627

shaders/src/shaders/galaxy_of_universes.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ pub const SHADER_DEFINITION: ShaderDefinition = ShaderDefinition {
1717

1818
pub fn shader_fn(render_instruction: &ShaderInput, render_result: &mut ShaderResult) {
1919
let color = &mut render_result.color;
20-
let (resolution, time, frag_coord) = (
21-
render_instruction.resolution,
22-
render_instruction.time,
23-
render_instruction.frag_coord,
24-
);
20+
let &ShaderInput {
21+
resolution,
22+
time,
23+
frag_coord,
24+
..
25+
} = render_instruction;
2526
Inputs { resolution, time }.main_image(color, frag_coord)
2627
}
2728

shaders/src/shaders/geodesic_tiling.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ pub const SHADER_DEFINITION: ShaderDefinition = ShaderDefinition {
88

99
pub fn shader_fn(render_instruction: &ShaderInput, render_result: &mut ShaderResult) {
1010
let color = &mut render_result.color;
11-
let (resolution, time, frag_coord, mouse) = (
12-
render_instruction.resolution,
13-
render_instruction.time,
14-
render_instruction.frag_coord,
15-
render_instruction.mouse,
16-
);
11+
let &ShaderInput {
12+
resolution,
13+
time,
14+
frag_coord,
15+
mouse,
16+
..
17+
} = render_instruction;
1718
State::new(Inputs {
1819
resolution,
1920
time,

0 commit comments

Comments
 (0)