diff --git a/native/src/widget/text_input/editor.rs b/native/src/widget/text_input/editor.rs index 71c4f292..c9b9795d 100644 --- a/native/src/widget/text_input/editor.rs +++ b/native/src/widget/text_input/editor.rs @@ -54,8 +54,7 @@ impl<'a> Editor<'a> { if start > 0 { self.cursor.move_left(self.value); - - let _ = self.value.remove(start - 1); + self.value.remove(start - 1); } } } @@ -70,7 +69,7 @@ impl<'a> Editor<'a> { let end = self.cursor.end(self.value); if end < self.value.len() { - let _ = self.value.remove(end); + self.value.remove(end); } } } diff --git a/wgpu/src/renderer.rs b/wgpu/src/renderer.rs index c06af339..e847cb64 100644 --- a/wgpu/src/renderer.rs +++ b/wgpu/src/renderer.rs @@ -103,8 +103,8 @@ impl Renderer { layers.push(Layer::new(Rectangle { x: 0, y: 0, - width: u32::from(width), - height: u32::from(height), + width, + height, })); self.draw_primitive(Vector::new(0.0, 0.0), primitive, &mut layers); @@ -356,7 +356,7 @@ impl Renderer { ) { let bounds = layer.bounds * scale_factor; - if layer.meshes.len() > 0 { + if !layer.meshes.is_empty() { let scaled = transformation * Transformation::scale(scale_factor, scale_factor); @@ -372,7 +372,7 @@ impl Renderer { ); } - if layer.quads.len() > 0 { + if !layer.quads.is_empty() { self.quad_pipeline.draw( device, encoder, @@ -386,7 +386,7 @@ impl Renderer { #[cfg(any(feature = "image", feature = "svg"))] { - if layer.images.len() > 0 { + if !layer.images.is_empty() { let scaled = transformation * Transformation::scale(scale_factor, scale_factor); @@ -402,7 +402,7 @@ impl Renderer { } } - if layer.text.len() > 0 { + if !layer.text.is_empty() { for text in layer.text.iter() { // Target physical coordinates directly to avoid blurry text let text = wgpu_glyph::Section { diff --git a/wgpu/src/renderer/widget/button.rs b/wgpu/src/renderer/widget/button.rs index 0de5bf5c..359b4866 100644 --- a/wgpu/src/renderer/widget/button.rs +++ b/wgpu/src/renderer/widget/button.rs @@ -10,7 +10,7 @@ impl iced_native::button::Renderer for Renderer { fn draw( &mut self, - defaults: &Defaults, + _defaults: &Defaults, bounds: Rectangle, cursor_position: Point, is_disabled: bool, @@ -39,7 +39,6 @@ impl iced_native::button::Renderer for Renderer { text: defaults::Text { color: styling.text_color, }, - ..*defaults }, content_layout, cursor_position, diff --git a/wgpu/src/renderer/widget/checkbox.rs b/wgpu/src/renderer/widget/checkbox.rs index 1a0585d3..ecacf1de 100644 --- a/wgpu/src/renderer/widget/checkbox.rs +++ b/wgpu/src/renderer/widget/checkbox.rs @@ -38,7 +38,7 @@ impl checkbox::Renderer for Renderer { content: crate::text::CHECKMARK_ICON.to_string(), font: crate::text::BUILTIN_ICONS, size: bounds.height * 0.7, - bounds: bounds, + bounds, color: style.checkmark_color, horizontal_alignment: HorizontalAlignment::Center, vertical_alignment: VerticalAlignment::Center, diff --git a/wgpu/src/renderer/widget/container.rs b/wgpu/src/renderer/widget/container.rs index 2d4d1db8..dda7dc8a 100644 --- a/wgpu/src/renderer/widget/container.rs +++ b/wgpu/src/renderer/widget/container.rs @@ -19,7 +19,6 @@ impl iced_native::container::Renderer for Renderer { text: defaults::Text { color: style.text_color.unwrap_or(defaults.text.color), }, - ..*defaults }; let (content, mouse_cursor) = diff --git a/wgpu/src/renderer/widget/text_input.rs b/wgpu/src/renderer/widget/text_input.rs index 170ac3c5..9093b0c6 100644 --- a/wgpu/src/renderer/widget/text_input.rs +++ b/wgpu/src/renderer/widget/text_input.rs @@ -106,8 +106,7 @@ impl text_input::Renderer for Renderer { style_sheet.placeholder_color() } else { style_sheet.value_color() - } - .into(), + }, font, bounds: Rectangle { width: f32::INFINITY, diff --git a/wgpu/src/settings.rs b/wgpu/src/settings.rs index f946ce0d..5ee245b6 100644 --- a/wgpu/src/settings.rs +++ b/wgpu/src/settings.rs @@ -45,7 +45,7 @@ pub enum Antialiasing { } impl Antialiasing { - pub(crate) fn sample_count(&self) -> u32 { + pub(crate) fn sample_count(self) -> u32 { match self { Antialiasing::MSAAx2 => 2, Antialiasing::MSAAx4 => 4, diff --git a/wgpu/src/transformation.rs b/wgpu/src/transformation.rs index 666696f3..c991f330 100644 --- a/wgpu/src/transformation.rs +++ b/wgpu/src/transformation.rs @@ -49,6 +49,6 @@ impl AsRef<[f32; 16]> for Transformation { impl From for [f32; 16] { fn from(t: Transformation) -> [f32; 16] { - t.as_ref().clone() + *t.as_ref() } } diff --git a/wgpu/src/triangle/msaa.rs b/wgpu/src/triangle/msaa.rs index 7ccfb062..f65f0a00 100644 --- a/wgpu/src/triangle/msaa.rs +++ b/wgpu/src/triangle/msaa.rs @@ -120,7 +120,7 @@ impl Blit { format, pipeline, constants: constant_bind_group, - texture_layout: texture_layout, + texture_layout, sample_count: antialiasing.sample_count(), targets: None, } diff --git a/winit/src/application.rs b/winit/src/application.rs index a647a1b6..b9d5fed8 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -123,7 +123,7 @@ pub trait Application: Sized { Runtime::new(executor, Proxy::new(event_loop.create_proxy())) }; - let (mut application, init_command) = runtime.enter(|| Self::new()); + let (mut application, init_command) = runtime.enter(Self::new); runtime.spawn(init_command); let subscription = application.subscription();