From d97a369c44ec38fae4c8dcb13f9e664621eb94b5 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Wed, 20 Oct 2021 16:43:40 +0200 Subject: [PATCH] End statements with semicolon (clippy::semicolon_if_nothing_returned) --- egui-winit/src/lib.rs | 2 +- egui/src/containers/area.rs | 2 +- egui/src/data/output.rs | 2 +- egui/src/id.rs | 22 +++++++++---------- egui/src/input_state.rs | 2 +- egui/src/layers.rs | 2 +- egui/src/painter.rs | 4 ++-- egui/src/placer.rs | 12 +++++----- egui/src/response.rs | 4 ++-- egui/src/style.rs | 10 ++++----- egui/src/ui.rs | 8 +++---- egui/src/util/cache.rs | 2 +- egui/src/util/history.rs | 2 +- egui/src/widgets/drag_value.rs | 4 ++-- egui/src/widgets/plot/items.rs | 8 +++---- egui/src/widgets/plot/mod.rs | 2 +- egui/src/widgets/slider.rs | 2 +- egui/src/widgets/text_edit.rs | 2 +- egui_demo_lib/src/apps/demo/app.rs | 2 +- .../src/easy_mark/easy_mark_editor.rs | 2 +- .../src/easy_mark/easy_mark_highlighter.rs | 2 +- .../src/easy_mark/easy_mark_viewer.rs | 2 +- egui_demo_lib/src/wrap_app.rs | 2 +- egui_glium/src/epi_backend.rs | 2 +- egui_glium/src/painter.rs | 2 +- egui_glow/src/epi_backend.rs | 2 +- egui_glow/src/lib.rs | 2 +- egui_glow/src/painter.rs | 2 +- epaint/src/lib.rs | 6 ++--- epaint/src/mesh.rs | 2 +- epaint/src/mutex.rs | 2 +- epaint/src/shape_transform.rs | 2 +- epaint/src/stats.rs | 1 - epaint/src/tessellator.rs | 14 ++++++------ epaint/src/text/text_layout.rs | 4 ++-- 35 files changed, 71 insertions(+), 72 deletions(-) diff --git a/egui-winit/src/lib.rs b/egui-winit/src/lib.rs index da6164cb..5f397e90 100644 --- a/egui-winit/src/lib.rs +++ b/egui-winit/src/lib.rs @@ -536,7 +536,7 @@ impl State { } if let Some(egui::Pos2 { x, y }) = output.text_cursor_pos { - window.set_ime_position(winit::dpi::LogicalPosition { x, y }) + window.set_ime_position(winit::dpi::LogicalPosition { x, y }); } } diff --git a/egui/src/containers/area.rs b/egui/src/containers/area.rs index ec91371d..e4b9b0cc 100644 --- a/egui/src/containers/area.rs +++ b/egui/src/containers/area.rs @@ -213,7 +213,7 @@ impl Area { if let Some((anchor, offset)) = anchor { if is_new { // unknown size - ctx.request_repaint() + ctx.request_repaint(); } else { let screen = ctx.available_rect(); state.pos = anchor.align_size_within_rect(state.size, screen).min + offset; diff --git a/egui/src/data/output.rs b/egui/src/data/output.rs index 0ec1a319..bd36c1b6 100644 --- a/egui/src/data/output.rs +++ b/egui/src/data/output.rs @@ -37,7 +37,7 @@ impl Output { /// Open the given url in a web browser. /// If egui is running in a browser, the same tab will be reused. pub fn open_url(&mut self, url: impl ToString) { - self.open_url = Some(OpenUrl::same_tab(url)) + self.open_url = Some(OpenUrl::same_tab(url)); } /// This can be used by a text-to-speech system to describe the events (if any). diff --git a/egui/src/id.rs b/egui/src/id.rs index 2242b330..af15db83 100644 --- a/egui/src/id.rs +++ b/egui/src/id.rs @@ -76,39 +76,39 @@ pub struct IdHasher(u64); impl std::hash::Hasher for IdHasher { fn write(&mut self, _: &[u8]) { - unreachable!("Invalid use of IdHasher") + unreachable!("Invalid use of IdHasher"); } fn write_u8(&mut self, _n: u8) { - unreachable!("Invalid use of IdHasher") + unreachable!("Invalid use of IdHasher"); } fn write_u16(&mut self, _n: u16) { - unreachable!("Invalid use of IdHasher") + unreachable!("Invalid use of IdHasher"); } fn write_u32(&mut self, _n: u32) { - unreachable!("Invalid use of IdHasher") + unreachable!("Invalid use of IdHasher"); } fn write_u64(&mut self, n: u64) { - self.0 = n + self.0 = n; } fn write_usize(&mut self, _n: usize) { - unreachable!("Invalid use of IdHasher") + unreachable!("Invalid use of IdHasher"); } fn write_i8(&mut self, _n: i8) { - unreachable!("Invalid use of IdHasher") + unreachable!("Invalid use of IdHasher"); } fn write_i16(&mut self, _n: i16) { - unreachable!("Invalid use of IdHasher") + unreachable!("Invalid use of IdHasher"); } fn write_i32(&mut self, _n: i32) { - unreachable!("Invalid use of IdHasher") + unreachable!("Invalid use of IdHasher"); } fn write_i64(&mut self, _n: i64) { - unreachable!("Invalid use of IdHasher") + unreachable!("Invalid use of IdHasher"); } fn write_isize(&mut self, _n: isize) { - unreachable!("Invalid use of IdHasher") + unreachable!("Invalid use of IdHasher"); } fn finish(&self) -> u64 { diff --git a/egui/src/input_state.rs b/egui/src/input_state.rs index cc75db3e..80d658c6 100644 --- a/egui/src/input_state.rs +++ b/egui/src/input_state.rs @@ -687,7 +687,7 @@ impl InputState { for (device_id, touch_state) in touch_states { ui.collapsing(format!("Touch State [device {}]", device_id.0), |ui| { - touch_state.ui(ui) + touch_state.ui(ui); }); } diff --git a/egui/src/layers.rs b/egui/src/layers.rs index 7c179a2c..69a13a37 100644 --- a/egui/src/layers.rs +++ b/egui/src/layers.rs @@ -128,7 +128,7 @@ impl PaintList { pub fn extend(&mut self, clip_rect: Rect, mut shapes: Vec) { self.0 - .extend(shapes.drain(..).map(|shape| ClippedShape(clip_rect, shape))) + .extend(shapes.drain(..).map(|shape| ClippedShape(clip_rect, shape))); } /// Modify an existing [`Shape`]. diff --git a/egui/src/painter.rs b/egui/src/painter.rs index 4426f222..f76838ce 100644 --- a/egui/src/painter.rs +++ b/egui/src/painter.rs @@ -72,7 +72,7 @@ impl Painter { /// If `false`, nothing added to the painter will be visible pub(crate) fn set_invisible(&mut self) { - self.fade_to_color = Some(Color32::TRANSPARENT) + self.fade_to_color = Some(Color32::TRANSPARENT); } /// Create a painter for a sub-region of this `Painter`. @@ -189,7 +189,7 @@ impl Painter { } let mut shape = shape.into(); self.transform_shape(&mut shape); - self.paint_list.lock().set(idx, self.clip_rect, shape) + self.paint_list.lock().set(idx, self.clip_rect, shape); } } diff --git a/egui/src/placer.rs b/egui/src/placer.rs index aeafba25..6a9da6c5 100644 --- a/egui/src/placer.rs +++ b/egui/src/placer.rs @@ -70,7 +70,7 @@ impl Placer { #[inline(always)] pub(crate) fn set_cursor(&mut self, cursor: Rect) { - self.region.cursor = cursor + self.region.cursor = cursor; } } @@ -162,14 +162,14 @@ impl Placer { self.region.sanity_check(); if let Some(grid) = &mut self.grid { - grid.advance(&mut self.region.cursor, frame_rect, widget_rect) + grid.advance(&mut self.region.cursor, frame_rect, widget_rect); } else { self.layout.advance_after_rects( &mut self.region.cursor, frame_rect, widget_rect, item_spacing, - ) + ); } self.expand_to_include_rect(frame_rect); // e.g. for centered layouts: pretend we used whole frame @@ -181,9 +181,9 @@ impl Placer { /// Otherwise does nothing. pub(crate) fn end_row(&mut self, item_spacing: Vec2, painter: &Painter) { if let Some(grid) = &mut self.grid { - grid.end_row(&mut self.region.cursor, painter) + grid.end_row(&mut self.region.cursor, painter); } else { - self.layout.end_row(&mut self.region, item_spacing) + self.layout.end_row(&mut self.region, item_spacing); } } @@ -272,7 +272,7 @@ impl Placer { painter.debug_text(align.pos_in_rect(&rect), align, stroke.color, text); } else { self.layout - .paint_text_at_cursor(painter, &self.region, stroke, text) + .paint_text_at_cursor(painter, &self.region, stroke, text); } } } diff --git a/egui/src/response.rs b/egui/src/response.rs index bcdc49d2..0a345f6e 100644 --- a/egui/src/response.rs +++ b/egui/src/response.rs @@ -210,12 +210,12 @@ impl Response { /// Request that this widget get keyboard focus. pub fn request_focus(&self) { - self.ctx.memory().request_focus(self.id) + self.ctx.memory().request_focus(self.id); } /// Surrender keyboard focus for this widget. pub fn surrender_focus(&self) { - self.ctx.memory().surrender_focus(self.id) + self.ctx.memory().surrender_focus(self.id); } /// The widgets is being dragged. diff --git a/egui/src/style.rs b/egui/src/style.rs index 7e7d0e64..937c5c20 100644 --- a/egui/src/style.rs +++ b/egui/src/style.rs @@ -748,23 +748,23 @@ impl Widgets { ui.label( "The style of a widget that you cannot interact with, e.g. labels and separators.", ); - noninteractive.ui(ui) + noninteractive.ui(ui); }); ui.collapsing("Interactive but inactive", |ui| { ui.label("The style of an interactive widget, such as a button, at rest."); - inactive.ui(ui) + inactive.ui(ui); }); ui.collapsing("Interactive and hovered", |ui| { ui.label("The style of an interactive widget while you hover it."); - hovered.ui(ui) + hovered.ui(ui); }); ui.collapsing("Interactive and active", |ui| { ui.label("The style of an interactive widget as you are clicking or dragging it."); - active.ui(ui) + active.ui(ui); }); ui.collapsing("Open menu", |ui| { ui.label("The style of an open combo-box or menu button"); - open.ui(ui) + open.ui(ui); }); // ui.vertical_centered(|ui| reset_button(ui, self)); diff --git a/egui/src/ui.rs b/egui/src/ui.rs index f217b335..fbc70a29 100644 --- a/egui/src/ui.rs +++ b/egui/src/ui.rs @@ -381,7 +381,7 @@ impl Ui { /// Used for animation, kind of hacky pub(crate) fn force_set_min_rect(&mut self, min_rect: Rect) { - self.placer.force_set_min_rect(min_rect) + self.placer.force_set_min_rect(min_rect); } // ------------------------------------------------------------------------ @@ -432,13 +432,13 @@ impl Ui { /// so further widgets will try not to be wider than previous widgets. /// Useful for normal vertical layouts. pub fn shrink_width_to_current(&mut self) { - self.set_max_width(self.min_rect().width()) + self.set_max_width(self.min_rect().width()); } /// Helper: shrinks the max height to the current height, /// so further widgets will try not to be wider than previous widgets. pub fn shrink_height_to_current(&mut self) { - self.set_max_height(self.min_rect().height()) + self.set_max_height(self.min_rect().height()); } /// Expand the `min_rect` and `max_rect` of this ui to include a child at the given rect. @@ -741,7 +741,7 @@ impl Ui { } pub(crate) fn set_cursor(&mut self, cursor: Rect) { - self.placer.set_cursor(cursor) + self.placer.set_cursor(cursor); } /// Where do we expect a zero-sized widget to be placed? diff --git a/egui/src/util/cache.rs b/egui/src/util/cache.rs index 0c555ee1..9cca39bf 100644 --- a/egui/src/util/cache.rs +++ b/egui/src/util/cache.rs @@ -89,7 +89,7 @@ impl CacheTrait for FrameCache { fn update(&mut self) { - self.evice_cache() + self.evice_cache(); } fn len(&self) -> usize { diff --git a/egui/src/util/history.rs b/egui/src/util/history.rs index 0f2daf9f..7c02ed8c 100644 --- a/egui/src/util/history.rs +++ b/egui/src/util/history.rs @@ -119,7 +119,7 @@ where #[inline] pub fn clear(&mut self) { - self.values.clear() + self.values.clear(); } /// Values must be added with a monotonically increasing time, or at least not decreasing. diff --git a/egui/src/widgets/drag_value.rs b/egui/src/widgets/drag_value.rs index cecfac11..054e4e3c 100644 --- a/egui/src/widgets/drag_value.rs +++ b/egui/src/widgets/drag_value.rs @@ -61,7 +61,7 @@ impl<'a> DragValue<'a> { pub fn new(value: &'a mut Num) -> Self { let slf = Self::from_get_set(move |v: Option| { if let Some(v) = v { - *value = Num::from_f64(v) + *value = Num::from_f64(v); } value.to_f64() }); @@ -198,7 +198,7 @@ impl<'a> Widget for DragValue<'a> { ); if let Ok(parsed_value) = value_text.parse() { let parsed_value = clamp_to_range(parsed_value, clamp_range); - set(&mut get_set_value, parsed_value) + set(&mut get_set_value, parsed_value); } if ui.input().key_pressed(Key::Enter) { ui.memory().surrender_focus(kb_edit_id); diff --git a/egui/src/widgets/plot/items.rs b/egui/src/widgets/plot/items.rs index 48268744..6608b12a 100644 --- a/egui/src/widgets/plot/items.rs +++ b/egui/src/widgets/plot/items.rs @@ -89,7 +89,7 @@ impl LineStyle { if highlight { radius *= 2f32.sqrt(); } - shapes.extend(Shape::dotted_line(&line, stroke.color, *spacing, radius)) + shapes.extend(Shape::dotted_line(&line, stroke.color, *spacing, radius)); } LineStyle::Dashed { length } => { if highlight { @@ -101,7 +101,7 @@ impl LineStyle { stroke, *length, length * golden_ratio, - )) + )); } } } @@ -308,7 +308,7 @@ impl PlotItem for VLine { transform.position_from_value(&Value::new(*x, transform.bounds().min[1])), transform.position_from_value(&Value::new(*x, transform.bounds().max[1])), ]; - style.style_line(points, *stroke, *highlight, shapes) + style.style_line(points, *stroke, *highlight, shapes); } fn initialize(&mut self, _x_range: RangeInclusive) {} @@ -1395,7 +1395,7 @@ impl PlotItem for PlotImage { rect, 0.0, Stroke::new(1.0, ui.visuals().strong_text_color()), - )) + )); } } diff --git a/egui/src/widgets/plot/mod.rs b/egui/src/widgets/plot/mod.rs index 1576093b..82fc0856 100644 --- a/egui/src/widgets/plot/mod.rs +++ b/egui/src/widgets/plot/mod.rs @@ -452,7 +452,7 @@ impl Widget for Plot { bounds.make_x_symmetrical(); }; if center_y_axis { - bounds.make_y_symmetrical() + bounds.make_y_symmetrical(); }; let mut transform = ScreenTransform::new(rect, bounds, center_x_axis, center_y_axis); diff --git a/egui/src/widgets/slider.rs b/egui/src/widgets/slider.rs index 28996178..103685e2 100644 --- a/egui/src/widgets/slider.rs +++ b/egui/src/widgets/slider.rs @@ -71,7 +71,7 @@ impl<'a> Slider<'a> { let range_f64 = range.start().to_f64()..=range.end().to_f64(); let slf = Self::from_get_set(range_f64, move |v: Option| { if let Some(v) = v { - *value = Num::from_f64(v) + *value = Num::from_f64(v); } value.to_f64() }); diff --git a/egui/src/widgets/text_edit.rs b/egui/src/widgets/text_edit.rs index 2caa77e4..0630e6b6 100644 --- a/egui/src/widgets/text_edit.rs +++ b/egui/src/widgets/text_edit.rs @@ -455,7 +455,7 @@ impl<'t> Widget for TextEdit<'t> { let frame_rect = response.rect.expand2(margin); ui.allocate_space(frame_rect.size()); if interactive { - response |= ui.interact(frame_rect, id, Sense::click()) + response |= ui.interact(frame_rect, id, Sense::click()); } if response.clicked() && !response.lost_focus() { ui.memory().request_focus(response.id); diff --git a/egui_demo_lib/src/apps/demo/app.rs b/egui_demo_lib/src/apps/demo/app.rs index 8f1f3cf4..7cd2ba38 100644 --- a/egui_demo_lib/src/apps/demo/app.rs +++ b/egui_demo_lib/src/apps/demo/app.rs @@ -22,7 +22,7 @@ impl epi::App for DemoApp { ) { #[cfg(feature = "persistence")] if let Some(storage) = _storage { - *self = epi::get_value(storage, epi::APP_KEY).unwrap_or_default() + *self = epi::get_value(storage, epi::APP_KEY).unwrap_or_default(); } } diff --git a/egui_demo_lib/src/easy_mark/easy_mark_editor.rs b/egui_demo_lib/src/easy_mark/easy_mark_editor.rs index f0c85ecb..3e752a31 100644 --- a/egui_demo_lib/src/easy_mark/easy_mark_editor.rs +++ b/egui_demo_lib/src/easy_mark/easy_mark_editor.rs @@ -69,7 +69,7 @@ impl EasyMarkEditor { } else { ScrollArea::vertical() .id_source("source") - .show(ui, |ui| self.editor_ui(ui)) + .show(ui, |ui| self.editor_ui(ui)); } } diff --git a/egui_demo_lib/src/easy_mark/easy_mark_highlighter.rs b/egui_demo_lib/src/easy_mark/easy_mark_highlighter.rs index 12f271e1..67c2c859 100644 --- a/egui_demo_lib/src/easy_mark/easy_mark_highlighter.rs +++ b/egui_demo_lib/src/easy_mark/easy_mark_highlighter.rs @@ -15,7 +15,7 @@ impl MemoizedEasymarkHighlighter { if (&self.visuals, self.code.as_str()) != (visuals, code) { self.visuals = visuals.clone(); self.code = code.to_owned(); - self.output = highlight_easymark(visuals, code) + self.output = highlight_easymark(visuals, code); } self.output.clone() } diff --git a/egui_demo_lib/src/easy_mark/easy_mark_viewer.rs b/egui_demo_lib/src/easy_mark/easy_mark_viewer.rs index 0247027f..faffd396 100644 --- a/egui_demo_lib/src/easy_mark/easy_mark_viewer.rs +++ b/egui_demo_lib/src/easy_mark/easy_mark_viewer.rs @@ -3,7 +3,7 @@ use egui::*; /// Parse and display a VERY simple and small subset of Markdown. pub fn easy_mark(ui: &mut Ui, easy_mark: &str) { - easy_mark_it(ui, easy_mark::Parser::new(easy_mark)) + easy_mark_it(ui, easy_mark::Parser::new(easy_mark)); } pub fn easy_mark_it<'em>(ui: &mut Ui, items: impl Iterator>) { diff --git a/egui_demo_lib/src/wrap_app.rs b/egui_demo_lib/src/wrap_app.rs index caa1dd54..60c706bb 100644 --- a/egui_demo_lib/src/wrap_app.rs +++ b/egui_demo_lib/src/wrap_app.rs @@ -50,7 +50,7 @@ impl epi::App for WrapApp { ) { #[cfg(feature = "persistence")] if let Some(storage) = _storage { - *self = epi::get_value(storage, epi::APP_KEY).unwrap_or_default() + *self = epi::get_value(storage, epi::APP_KEY).unwrap_or_default(); } } diff --git a/egui_glium/src/epi_backend.rs b/egui_glium/src/epi_backend.rs index 56e37648..e6c4ed3d 100644 --- a/egui_glium/src/epi_backend.rs +++ b/egui_glium/src/epi_backend.rs @@ -16,7 +16,7 @@ impl epi::TextureAllocator for Painter { } fn free(&mut self, id: egui::TextureId) { - self.free_user_texture(id) + self.free_user_texture(id); } } diff --git a/egui_glium/src/painter.rs b/egui_glium/src/painter.rs index dd003afa..9801fecd 100644 --- a/egui_glium/src/painter.rs +++ b/egui_glium/src/painter.rs @@ -109,7 +109,7 @@ impl Painter { self.upload_pending_user_textures(display); for egui::ClippedMesh(clip_rect, mesh) in cipped_meshes { - self.paint_mesh(target, display, pixels_per_point, clip_rect, &mesh) + self.paint_mesh(target, display, pixels_per_point, clip_rect, &mesh); } } diff --git a/egui_glow/src/epi_backend.rs b/egui_glow/src/epi_backend.rs index bec38b4a..90812b0b 100644 --- a/egui_glow/src/epi_backend.rs +++ b/egui_glow/src/epi_backend.rs @@ -16,7 +16,7 @@ impl epi::TextureAllocator for Painter { } fn free(&mut self, id: egui::TextureId) { - self.free_user_texture(id) + self.free_user_texture(id); } } diff --git a/egui_glow/src/lib.rs b/egui_glow/src/lib.rs index 89af6eba..ae3f3bd0 100644 --- a/egui_glow/src/lib.rs +++ b/egui_glow/src/lib.rs @@ -200,6 +200,6 @@ impl EguiGlow { } pub fn destroy(&mut self, gl: &glow::Context) { - self.painter.destroy(gl) + self.painter.destroy(gl); } } diff --git a/egui_glow/src/painter.rs b/egui_glow/src/painter.rs index 9ef4bad6..7ee250aa 100644 --- a/egui_glow/src/painter.rs +++ b/egui_glow/src/painter.rs @@ -365,7 +365,7 @@ impl Painter { let size_in_pixels = unsafe { self.prepare_painting(gl_window, gl, pixels_per_point) }; for egui::ClippedMesh(clip_rect, mesh) in clipped_meshes { - self.paint_mesh(gl, size_in_pixels, pixels_per_point, clip_rect, &mesh) + self.paint_mesh(gl, size_in_pixels, pixels_per_point, clip_rect, &mesh); } assert_eq!( diff --git a/epaint/src/lib.rs b/epaint/src/lib.rs index d933d8e7..046045e3 100644 --- a/epaint/src/lib.rs +++ b/epaint/src/lib.rs @@ -188,11 +188,11 @@ macro_rules! epaint_assert { #[inline(always)] pub(crate) fn f32_hash(state: &mut H, f: f32) { if f == 0.0 { - state.write_u8(0) + state.write_u8(0); } else if f.is_nan() { - state.write_u8(1) + state.write_u8(1); } else { use std::hash::Hash; - f.to_bits().hash(state) + f.to_bits().hash(state); } } diff --git a/epaint/src/mesh.rs b/epaint/src/mesh.rs index 8218a9ce..6ff3289a 100644 --- a/epaint/src/mesh.rs +++ b/epaint/src/mesh.rs @@ -170,7 +170,7 @@ impl Mesh { #[inline(always)] pub fn add_colored_rect(&mut self, rect: Rect, color: Color32) { crate::epaint_assert!(self.texture_id == TextureId::Egui); - self.add_rect_with_uv(rect, [WHITE_UV, WHITE_UV].into(), color) + self.add_rect_with_uv(rect, [WHITE_UV, WHITE_UV].into(), color); } /// This is for platforms that only support 16-bit index buffers. diff --git a/epaint/src/mutex.rs b/epaint/src/mutex.rs index e0163ddb..932ef2e0 100644 --- a/epaint/src/mutex.rs +++ b/epaint/src/mutex.rs @@ -44,7 +44,7 @@ impl Mutex { // Store it in thread local storage while we have a lock guard taken out HELD_LOCKS_TLS.with(|locks| { if locks.borrow().contains(&ptr) { - panic!("Recursively locking a Mutex in the same thread is not supported") + panic!("Recursively locking a Mutex in the same thread is not supported"); } else { locks.borrow_mut().insert(ptr); } diff --git a/epaint/src/shape_transform.rs b/epaint/src/shape_transform.rs index 6215c2d2..b3ffc19d 100644 --- a/epaint/src/shape_transform.rs +++ b/epaint/src/shape_transform.rs @@ -6,7 +6,7 @@ pub fn adjust_colors(shape: &mut Shape, adjust_color: &impl Fn(&mut Color32)) { Shape::Noop => {} Shape::Vec(shapes) => { for shape in shapes { - adjust_colors(shape, adjust_color) + adjust_colors(shape, adjust_color); } } Shape::Circle(circle_shape) => { diff --git a/epaint/src/stats.rs b/epaint/src/stats.rs index 2f3b334b..ad7a0c88 100644 --- a/epaint/src/stats.rs +++ b/epaint/src/stats.rs @@ -196,7 +196,6 @@ impl PaintStats { } } Shape::Noop | Shape::Circle { .. } | Shape::LineSegment { .. } | Shape::Rect { .. } => { - Default::default() } Shape::Path(path_shape) => { self.shape_path += AllocInfo::from_slice(&path_shape.points); diff --git a/epaint/src/tessellator.rs b/epaint/src/tessellator.rs index 236640f0..da06d879 100644 --- a/epaint/src/tessellator.rs +++ b/epaint/src/tessellator.rs @@ -41,7 +41,7 @@ impl Path { #[inline(always)] pub fn reserve(&mut self, additional: usize) { - self.0.reserve(additional) + self.0.reserve(additional); } #[inline(always)] @@ -153,12 +153,12 @@ impl Path { /// Open-ended. pub fn stroke_open(&self, stroke: Stroke, options: &TessellationOptions, out: &mut Mesh) { - stroke_path(&self.0, PathType::Open, stroke, options, out) + stroke_path(&self.0, PathType::Open, stroke, options, out); } /// A closed path (returning to the first point). pub fn stroke_closed(&self, stroke: Stroke, options: &TessellationOptions, out: &mut Mesh) { - stroke_path(&self.0, PathType::Closed, stroke, options, out) + stroke_path(&self.0, PathType::Closed, stroke, options, out); } pub fn stroke( @@ -168,12 +168,12 @@ impl Path { options: &TessellationOptions, out: &mut Mesh, ) { - stroke_path(&self.0, path_type, stroke, options, out) + stroke_path(&self.0, path_type, stroke, options, out); } /// The path is taken to be closed (i.e. returning to the start again). pub fn fill(&self, color: Color32, options: &TessellationOptions, out: &mut Mesh) { - fill_closed_path(&self.0, color, options, out) + fill_closed_path(&self.0, color, options, out); } } @@ -549,7 +549,7 @@ impl Tessellator { Shape::Noop => {} Shape::Vec(vec) => { for shape in vec { - self.tessellate_shape(tex_size, shape, out) + self.tessellate_shape(tex_size, shape, out); } } Shape::Circle(CircleShape { @@ -837,7 +837,7 @@ pub fn tessellate_shapes( Stroke::new(2.0, Color32::from_rgb(150, 255, 150)), ), mesh, - ) + ); } } diff --git a/epaint/src/text/text_layout.rs b/epaint/src/text/text_layout.rs index bdcb1eef..7483f4e9 100644 --- a/epaint/src/text/text_layout.rs +++ b/epaint/src/text/text_layout.rs @@ -34,7 +34,7 @@ pub fn layout(fonts: &Fonts, job: Arc) -> Galley { for (i, row) in rows.iter_mut().enumerate() { let is_last_row = i + 1 == num_rows; let justify_row = justify && !row.ends_with_newline && !is_last_row; - halign_and_jusitfy_row(fonts, row, job.halign, job.wrap_width, justify_row) + halign_and_jusitfy_row(fonts, row, job.halign, job.wrap_width, justify_row); } } @@ -74,7 +74,7 @@ fn layout_section( let (font_impl, glyph_info) = font.glyph_info_and_font_impl(chr); if let Some(font_impl) = font_impl { if let Some(last_glyph_id) = last_glyph_id { - paragraph.cursor_x += font_impl.pair_kerning(last_glyph_id, glyph_info.id) + paragraph.cursor_x += font_impl.pair_kerning(last_glyph_id, glyph_info.id); } }