From 07216033bccabfe38420bfec5540eaab230248d4 Mon Sep 17 00:00:00 2001 From: Jinlei Li Date: Wed, 6 Nov 2024 16:51:17 +0800 Subject: [PATCH] Fix clippy warning --- simuverse/src/egui_lib/mod.rs | 2 +- simuverse/src/field_simulator.rs | 6 +----- simuverse/src/setting/control_panel.rs | 6 +++--- simuverse/src/truck/platform/mod.rs | 1 + 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/simuverse/src/egui_lib/mod.rs b/simuverse/src/egui_lib/mod.rs index 5b6955a..dbea1b4 100644 --- a/simuverse/src/egui_lib/mod.rs +++ b/simuverse/src/egui_lib/mod.rs @@ -1,7 +1,7 @@ pub(crate) fn show_code(ui: &mut egui::Ui, code: &str) { let code = remove_leading_indentation(code.trim_start_matches('\n')); let language = "rs"; - let theme = egui_extras::syntax_highlighting::CodeTheme::from_memory(ui.ctx(), &ui.style()); + let theme = egui_extras::syntax_highlighting::CodeTheme::from_memory(ui.ctx(), ui.style()); egui_extras::syntax_highlighting::code_view_ui(ui, &theme, &code, language); } diff --git a/simuverse/src/field_simulator.rs b/simuverse/src/field_simulator.rs index 9acc791..1075e06 100644 --- a/simuverse/src/field_simulator.rs +++ b/simuverse/src/field_simulator.rs @@ -31,11 +31,7 @@ impl FieldSimulator { canvas_size.y / pixel_distance, ); - let field_workgroup_count = ( - (field_size.x + 15) / 16, - (field_size.y + 15) / 16, - 1, - ); + let field_workgroup_count = ((field_size.x + 15) / 16, (field_size.y + 15) / 16, 1); let (_, sx, sy) = crate::util::matrix_helper::fullscreen_factor( (canvas_size.x as f32, canvas_size.y as f32).into(), 75.0 / 180.0 * std::f32::consts::PI, diff --git a/simuverse/src/setting/control_panel.rs b/simuverse/src/setting/control_panel.rs index a992a93..00ff0ee 100644 --- a/simuverse/src/setting/control_panel.rs +++ b/simuverse/src/setting/control_panel.rs @@ -268,12 +268,12 @@ impl ControlPanel { ui.selectable_value(&mut self.selected_code_snippet, Some(3), "黑洞"); }); - let theme = egui_extras::syntax_highlighting::CodeTheme::from_memory(ui.ctx(), &ui.style()); + let theme = egui_extras::syntax_highlighting::CodeTheme::from_memory(ui.ctx(), ui.style()); let mut layouter = |ui: &egui::Ui, string: &str, wrap_width: f32| { let mut layout_job = egui_extras::syntax_highlighting::highlight( ui.ctx(), - &ui.style(), + ui.style(), &theme, &crate::remove_leading_indentation(string), "rs", @@ -281,7 +281,7 @@ impl ControlPanel { layout_job.wrap.max_width = wrap_width; ui.fonts(|f| f.layout_job(layout_job)) }; - let theme = egui_extras::syntax_highlighting::CodeTheme::from_memory(ui.ctx(), &ui.style()); + let theme = egui_extras::syntax_highlighting::CodeTheme::from_memory(ui.ctx(), ui.style()); egui_extras::syntax_highlighting::code_view_ui( ui, &theme, diff --git a/simuverse/src/truck/platform/mod.rs b/simuverse/src/truck/platform/mod.rs index bc44f77..e71b6dd 100644 --- a/simuverse/src/truck/platform/mod.rs +++ b/simuverse/src/truck/platform/mod.rs @@ -268,6 +268,7 @@ pub struct Scene { #[derive(Debug, Clone)] pub struct DeviceHandler { pub device: Arc, + #[allow(dead_code)] pub queue: Arc, }