Skip to content

Commit cac5eff

Browse files
Clippy and fmt
1 parent f55e604 commit cac5eff

6 files changed

Lines changed: 20 additions & 19 deletions

File tree

src/painter/canvas.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ use wgpu::{Extent3d, TextureDescriptor, TextureDimension, TextureFormat, Texture
1010
/// Prepares the camera associated with each canvas.
1111
///
1212
/// Replaces the image handle when the canvas is resized and applies [`CanvasMode`] behaviours.
13-
pub fn update_canvases(mut canvases: Query<(&mut Canvas, &mut Camera, &mut RenderTarget, &mut Projection)>) {
13+
pub fn update_canvases(
14+
mut canvases: Query<(&mut Canvas, &mut Camera, &mut RenderTarget, &mut Projection)>,
15+
) {
1416
canvases
1517
.iter_mut()
1618
.for_each(|(mut canvas, mut camera, mut target, mut projection)| {

src/render/commands.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ pub fn prepare_shape_view_bind_groups(
7272
&shape_pipeline.view_layout.entries,
7373
)
7474
});
75-
75+
7676
let lut_bindings =
7777
get_lut_bindings(&images, &tonemapping_luts, tonemapping, &fallback_image);
7878
let view_bind_group = render_device.create_bind_group(
7979
"shape_view_bind_group",
80-
&view_bind_group_layout,
80+
view_bind_group_layout,
8181
&BindGroupEntries::with_indices((
8282
(0, view_binding.clone()),
8383
(1, globals.clone()),
@@ -120,7 +120,7 @@ pub fn prepare_shape_2d_texture_bind_groups<T: ShapeData>(
120120
.or_insert_with(|| {
121121
render_device.create_bind_group(
122122
"shape_texture_bind_group",
123-
&texture_bind_group_layout,
123+
texture_bind_group_layout,
124124
&BindGroupEntries::sequential((
125125
&gpu_image.texture_view,
126126
&gpu_image.sampler,
@@ -155,7 +155,7 @@ pub fn prepare_shape_3d_texture_bind_groups<T: ShapeData>(
155155
.or_insert_with(|| {
156156
render_device.create_bind_group(
157157
"shape_texture_bind_group",
158-
&texture_bind_group_layout,
158+
texture_bind_group_layout,
159159
&BindGroupEntries::sequential((
160160
&gpu_image.texture_view,
161161
&gpu_image.sampler,

src/render/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ pub trait ShapeData: Send + Sync + GpuArrayBufferable + 'static {
153153
let mut shader_defs = Vec::with_capacity(1);
154154

155155
if let Some(render_app) = app.get_sub_app(RenderApp) {
156-
if let Some(per_object_buffer_batch_size) =
157-
GpuArrayBuffer::<Self>::batch_size(&render_app.world().resource::<RenderDevice>().limits())
158-
{
156+
if let Some(per_object_buffer_batch_size) = GpuArrayBuffer::<Self>::batch_size(
157+
&render_app.world().resource::<RenderDevice>().limits(),
158+
) {
159159
shader_defs.push(ShaderDefVal::UInt(
160160
"PER_OBJECT_BUFFER_BATCH_SIZE".into(),
161161
per_object_buffer_batch_size,

src/render/pipeline.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,10 @@ impl<T: ShapeData> FromWorld for Shape2dPipeline<T> {
169169
"shape_layout",
170170
&BindGroupLayoutEntries::with_indices(
171171
ShaderStages::VERTEX,
172-
((0, GpuArrayBuffer::<T>::binding_layout(&render_device.limits())),),
172+
((
173+
0,
174+
GpuArrayBuffer::<T>::binding_layout(&render_device.limits()),
175+
),),
173176
),
174177
);
175178

src/render/render_2d.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,16 +184,14 @@ pub fn prepare_shape_2d_bind_group<T: ShapeData + 'static>(
184184
) {
185185
if let Some(binding) = shape_buffer.binding() {
186186
let bind_group_layout = layout.get_or_insert_with(|| {
187-
render_device.create_bind_group_layout(
188-
"shape_bind_group_layout",
189-
&pipeline.layout.entries,
190-
)
187+
render_device
188+
.create_bind_group_layout("shape_bind_group_layout", &pipeline.layout.entries)
191189
});
192190

193191
commands.insert_resource(Shape2dBindGroup {
194192
value: render_device.create_bind_group(
195193
"shape_bind_group",
196-
&bind_group_layout,
194+
bind_group_layout,
197195
&BindGroupEntries::single(binding),
198196
),
199197
_marker: PhantomData::<T>,

src/render/render_3d.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,16 +208,14 @@ pub fn prepare_shape_3d_bind_group<T: ShapeData + 'static>(
208208
) {
209209
if let Some(binding) = shape_buffer.binding() {
210210
let bind_group_layout = layout.get_or_insert_with(|| {
211-
render_device.create_bind_group_layout(
212-
"shape_bind_group_layout",
213-
&pipeline.layout.entries,
214-
)
211+
render_device
212+
.create_bind_group_layout("shape_bind_group_layout", &pipeline.layout.entries)
215213
});
216214

217215
commands.insert_resource(Shape3dBindGroup {
218216
value: render_device.create_bind_group(
219217
"shape_bind_group",
220-
&bind_group_layout,
218+
bind_group_layout,
221219
&BindGroupEntries::single(binding),
222220
),
223221
_marker: PhantomData::<T>,

0 commit comments

Comments
 (0)