From 2b0eab2bbcad44632cea7f00b6168207150f255d Mon Sep 17 00:00:00 2001 From: Arman Uguray Date: Tue, 18 Apr 2023 15:15:01 -0700 Subject: [PATCH] fix some clippy errors/warnings --- crates/encoding/src/config.rs | 6 +++--- crates/encoding/src/resolve.rs | 8 +++++--- src/engine.rs | 2 +- src/lib.rs | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/crates/encoding/src/config.rs b/crates/encoding/src/config.rs index 487a1bc..ddd7e2d 100644 --- a/crates/encoding/src/config.rs +++ b/crates/encoding/src/config.rs @@ -81,8 +81,8 @@ impl RenderConfig { let height_in_tiles = new_height / TILE_HEIGHT; let n_path_tags = layout.path_tags_size(); let workgroup_counts = - WorkgroupCounts::new(&layout, width_in_tiles, height_in_tiles, n_path_tags); - let buffer_sizes = BufferSizes::new(&layout, &workgroup_counts, n_path_tags); + WorkgroupCounts::new(layout, width_in_tiles, height_in_tiles, n_path_tags); + let buffer_sizes = BufferSizes::new(layout, &workgroup_counts, n_path_tags); Self { gpu: ConfigUniform { width_in_tiles, @@ -175,7 +175,7 @@ impl WorkgroupCounts { } /// Typed buffer size primitive. -#[derive(Copy, Clone, Eq, Ord, Default, Debug)] +#[derive(Copy, Clone, Eq, Default, Debug)] pub struct BufferSize { len: u32, _phantom: std::marker::PhantomData, diff --git a/crates/encoding/src/resolve.rs b/crates/encoding/src/resolve.rs index f434ded..0f72939 100644 --- a/crates/encoding/src/resolve.rs +++ b/crates/encoding/src/resolve.rs @@ -129,9 +129,11 @@ impl Resolver { self.resolve_pending_images(); let data = packed; data.clear(); - let mut layout = Layout::default(); - layout.n_paths = encoding.n_paths; - layout.n_clips = encoding.n_clips; + let mut layout = Layout { + n_paths: encoding.n_paths, + n_clips: encoding.n_clips, + ..Layout::default() + }; // Compute size of data buffer let n_path_tags = encoding.path_tags.len() + sizes.path_tags + encoding.n_open_clips as usize; diff --git a/src/engine.rs b/src/engine.rs index 1e6253d..28772cf 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -330,7 +330,7 @@ impl Engine { let format = proxy.format.to_wgpu(); queue.write_texture( wgpu::ImageCopyTexture { - texture: &texture, + texture, mip_level: 0, origin: wgpu::Origin3d { x: *x, y: *y, z: 0 }, aspect: TextureAspect::All, diff --git a/src/lib.rs b/src/lib.rs index 047d3b4..b0f35a6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -136,7 +136,7 @@ impl Renderer { if target.width != width || target.height != height { target = TargetTexture::new(device, width, height); } - self.render_to_texture(device, queue, scene, &target.view, ¶ms)?; + self.render_to_texture(device, queue, scene, &target.view, params)?; let blit = self .blit .as_ref()