From a0db0a4a616a1d7ffcf23db1129124d9dea5cc38 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Sat, 9 Mar 2024 22:33:30 +0700 Subject: [PATCH] clippy: Fix semicolon_if_nothing_returned lints. (#184) --- crates/xilem_web/src/app.rs | 2 +- crates/xilem_web/src/context.rs | 6 +++--- crates/xilem_web/src/vecmap.rs | 2 +- crates/xilem_web/web_examples/todomvc/src/state.rs | 4 ++-- examples/hello.rs | 4 ++-- examples/taffy.rs | 2 +- src/geometry.rs | 2 +- src/view/taffy_layout.rs | 4 ++-- src/widget/button.rs | 2 +- src/widget/core.rs | 2 +- src/widget/piet_scene_helpers.rs | 4 ++-- src/widget/switch.rs | 2 +- 12 files changed, 18 insertions(+), 18 deletions(-) diff --git a/crates/xilem_web/src/app.rs b/crates/xilem_web/src/app.rs index 56927615d..f1fda0285 100644 --- a/crates/xilem_web/src/app.rs +++ b/crates/xilem_web/src/app.rs @@ -51,7 +51,7 @@ impl + 'static, F: FnMut(&mut T) -> V + 'static> App VecMap { } pub fn clear(&mut self) { - self.0.clear() + self.0.clear(); } /// Returns `true` if the map contains no elements. diff --git a/crates/xilem_web/web_examples/todomvc/src/state.rs b/crates/xilem_web/web_examples/todomvc/src/state.rs index 98de0952c..13d5b860f 100644 --- a/crates/xilem_web/web_examples/todomvc/src/state.rs +++ b/crates/xilem_web/web_examples/todomvc/src/state.rs @@ -75,7 +75,7 @@ impl AppState { if let Some(ref mut todo) = self.todos.iter_mut().find(|todo| todo.id == id) { todo.title_editing.clear(); todo.title_editing.push_str(&todo.title); - self.editing_id = Some(id) + self.editing_id = Some(id); } } @@ -96,7 +96,7 @@ impl AppState { /// Save the current state to local_storage pub fn save(&self) { let raw = serde_json::to_string(self).unwrap_throw(); - storage().set_item(KEY, &raw).unwrap_throw() + storage().set_item(KEY, &raw).unwrap_throw(); } } diff --git a/examples/hello.rs b/examples/hello.rs index 1de432ab6..c1c86c060 100644 --- a/examples/hello.rs +++ b/examples/hello.rs @@ -26,7 +26,7 @@ fn app_logic(data: &mut AppData) -> impl View { data.count = 0; }), switch(data.is_on, |data: &mut AppData, value: bool| { - data.is_on = value + data.is_on = value; }), )), )) @@ -55,5 +55,5 @@ fn main() { }; let app = App::new(data, app_logic); - AppLauncher::new(app).run() + AppLauncher::new(app).run(); } diff --git a/examples/taffy.rs b/examples/taffy.rs index c58791158..de9e672b2 100644 --- a/examples/taffy.rs +++ b/examples/taffy.rs @@ -126,5 +126,5 @@ fn app_logic(state: &mut AppState) -> impl View { fn main() { let app = App::new(AppState::new(), app_logic); - AppLauncher::new(app).run() + AppLauncher::new(app).run(); } diff --git a/src/geometry.rs b/src/geometry.rs index 5d49b4525..7fa12da81 100644 --- a/src/geometry.rs +++ b/src/geometry.rs @@ -62,7 +62,7 @@ impl Axis { /// Updates the scalar of value on the orthogonal axis. pub fn set_minor(self, value: &mut T, major: T::Scalar) { - self.cross().set_major(value, major) + self.cross().set_major(value, major); } /// Maps the scalar of the value on this axis. diff --git a/src/view/taffy_layout.rs b/src/view/taffy_layout.rs index 1b8e67f4a..b7f6d472b 100644 --- a/src/view/taffy_layout.rs +++ b/src/view/taffy_layout.rs @@ -127,7 +127,7 @@ impl> View for TaffyLayout { if self.background_color != prev.background_color { element.background_color = self.background_color; - flags |= ChangeFlags::PAINT + flags |= ChangeFlags::PAINT; } if self.style != prev.style { @@ -137,7 +137,7 @@ impl> View for TaffyLayout { // Clear layout cache if the layout ChangeFlag is set if flags.contains(ChangeFlags::LAYOUT) || flags.contains(ChangeFlags::TREE) { - element.cache.clear() + element.cache.clear(); } flags diff --git a/src/widget/button.rs b/src/widget/button.rs index b19c8bd9e..c05081147 100644 --- a/src/widget/button.rs +++ b/src/widget/button.rs @@ -72,7 +72,7 @@ impl Widget for Button { fn lifecycle(&mut self, cx: &mut LifeCycleCx, event: &LifeCycle) { if let LifeCycle::HotChanged(_) = event { - cx.request_paint() + cx.request_paint(); } } diff --git a/src/widget/core.rs b/src/widget/core.rs index c4e0fbc36..19f348030 100644 --- a/src/widget/core.rs +++ b/src/widget/core.rs @@ -149,7 +149,7 @@ impl WidgetState { } fn request(&mut self, flags: PodFlags) { - self.flags |= flags + self.flags |= flags; } } diff --git a/src/widget/piet_scene_helpers.rs b/src/widget/piet_scene_helpers.rs index bdda53a5a..aecacf4ba 100644 --- a/src/widget/piet_scene_helpers.rs +++ b/src/widget/piet_scene_helpers.rs @@ -22,7 +22,7 @@ pub fn stroke<'b>( brush, None, path, - ) + ); } // Note: copied from piet @@ -77,5 +77,5 @@ pub fn fill_lin_gradient( } pub fn fill_color(scene: &mut Scene, path: &impl Shape, color: Color) { - scene.fill(Fill::NonZero, Affine::IDENTITY, color, None, path) + scene.fill(Fill::NonZero, Affine::IDENTITY, color, None, path); } diff --git a/src/widget/switch.rs b/src/widget/switch.rs index 21a080706..33edd8762 100644 --- a/src/widget/switch.rs +++ b/src/widget/switch.rs @@ -74,7 +74,7 @@ impl Widget for Switch { Event::MouseUp(_) => { if self.is_dragging { if self.is_on != (self.knob_position.x > SWITCH_WIDTH / 2.0) { - cx.add_message(Message::new(self.id_path.clone(), ())) + cx.add_message(Message::new(self.id_path.clone(), ())); } } else if cx.is_active() { cx.add_message(Message::new(self.id_path.clone(), ()));