From b23945c78a6e4600cde29b928941297d45cc3d1f Mon Sep 17 00:00:00 2001 From: Lain-dono Date: Thu, 16 Apr 2020 09:06:05 +0300 Subject: [PATCH] Change `&mut wgpu::Device` to `&wgpu::Device` (#299) * Change `&mut wgpu::Device` to `&wgpu::Device` * Fix for rustfmt --- wgpu/src/image.rs | 2 +- wgpu/src/quad.rs | 7 ++----- wgpu/src/renderer.rs | 6 +++--- wgpu/src/text.rs | 4 ++-- wgpu/src/triangle.rs | 4 ++-- 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/wgpu/src/image.rs b/wgpu/src/image.rs index 7145f3f3..ea5dc09d 100644 --- a/wgpu/src/image.rs +++ b/wgpu/src/image.rs @@ -280,7 +280,7 @@ impl Pipeline { pub fn draw( &mut self, - device: &mut wgpu::Device, + device: &wgpu::Device, encoder: &mut wgpu::CommandEncoder, images: &[Image], transformation: Transformation, diff --git a/wgpu/src/quad.rs b/wgpu/src/quad.rs index 261d1d94..0c2d2244 100644 --- a/wgpu/src/quad.rs +++ b/wgpu/src/quad.rs @@ -15,10 +15,7 @@ pub struct Pipeline { } impl Pipeline { - pub fn new( - device: &mut wgpu::Device, - format: wgpu::TextureFormat, - ) -> Pipeline { + pub fn new(device: &wgpu::Device, format: wgpu::TextureFormat) -> Pipeline { let constant_layout = device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor { label: None, @@ -180,7 +177,7 @@ impl Pipeline { pub fn draw( &mut self, - device: &mut wgpu::Device, + device: &wgpu::Device, encoder: &mut wgpu::CommandEncoder, instances: &[Quad], transformation: Transformation, diff --git a/wgpu/src/renderer.rs b/wgpu/src/renderer.rs index c886bed0..481b310c 100644 --- a/wgpu/src/renderer.rs +++ b/wgpu/src/renderer.rs @@ -54,7 +54,7 @@ impl Renderer { /// Creates a new [`Renderer`]. /// /// [`Renderer`]: struct.Renderer.html - pub fn new(device: &mut wgpu::Device, settings: Settings) -> Self { + pub fn new(device: &wgpu::Device, settings: Settings) -> Self { let text_pipeline = text::Pipeline::new(device, settings.format, settings.default_font); let quad_pipeline = quad::Pipeline::new(device, settings.format); @@ -85,7 +85,7 @@ impl Renderer { /// [`Target`]: struct.Target.html pub fn draw>( &mut self, - device: &mut wgpu::Device, + device: &wgpu::Device, encoder: &mut wgpu::CommandEncoder, target: Target<'_>, (primitive, mouse_cursor): &(Primitive, MouseCursor), @@ -328,7 +328,7 @@ impl Renderer { fn flush( &mut self, - device: &mut wgpu::Device, + device: &wgpu::Device, scale_factor: f32, transformation: Transformation, layer: &Layer<'_>, diff --git a/wgpu/src/text.rs b/wgpu/src/text.rs index c5670102..f4521e72 100644 --- a/wgpu/src/text.rs +++ b/wgpu/src/text.rs @@ -23,7 +23,7 @@ pub struct Pipeline { impl Pipeline { pub fn new( - device: &mut wgpu::Device, + device: &wgpu::Device, format: wgpu::TextureFormat, default_font: Option<&[u8]>, ) -> Self { @@ -78,7 +78,7 @@ impl Pipeline { pub fn draw_queued( &mut self, - device: &mut wgpu::Device, + device: &wgpu::Device, encoder: &mut wgpu::CommandEncoder, target: &wgpu::TextureView, transformation: Transformation, diff --git a/wgpu/src/triangle.rs b/wgpu/src/triangle.rs index 471abe22..86c74fcd 100644 --- a/wgpu/src/triangle.rs +++ b/wgpu/src/triangle.rs @@ -63,7 +63,7 @@ impl Buffer { impl Pipeline { pub fn new( - device: &mut wgpu::Device, + device: &wgpu::Device, format: wgpu::TextureFormat, antialiasing: Option, ) -> Pipeline { @@ -195,7 +195,7 @@ impl Pipeline { pub fn draw( &mut self, - device: &mut wgpu::Device, + device: &wgpu::Device, encoder: &mut wgpu::CommandEncoder, target: &wgpu::TextureView, target_width: u32,