From 7da6204533f2edb49785986cc25ef7315c5003af Mon Sep 17 00:00:00 2001 From: shun suzuki Date: Wed, 18 Dec 2024 14:43:44 +0900 Subject: [PATCH] run clippy --- simulator/src/renderer/egui_renderer.rs | 16 ++++++++-------- simulator/src/renderer/mod.rs | 2 +- simulator/src/simulator.rs | 7 +++---- simulator/src/state/mod.rs | 8 ++++---- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/simulator/src/renderer/egui_renderer.rs b/simulator/src/renderer/egui_renderer.rs index 7e587e8..fdcd8e9 100644 --- a/simulator/src/renderer/egui_renderer.rs +++ b/simulator/src/renderer/egui_renderer.rs @@ -389,17 +389,17 @@ impl EguiRenderer { .default_open(true) .show(ctx, |ui| { ui.horizontal(|ui| { - ui.selectable_value(&mut state.tab, Tab::SLICE, "Slice"); - ui.selectable_value(&mut state.tab, Tab::CAMERA, "Camera"); - ui.selectable_value(&mut state.tab, Tab::CONFIG, "Config"); - ui.selectable_value(&mut state.tab, Tab::INFO, "Info"); + ui.selectable_value(&mut state.tab, Tab::Slice, "Slice"); + ui.selectable_value(&mut state.tab, Tab::Camera, "Camera"); + ui.selectable_value(&mut state.tab, Tab::Config, "Config"); + ui.selectable_value(&mut state.tab, Tab::Info, "Info"); }); ui.separator(); match state.tab { - Tab::SLICE => Self::slice_tab(ui, state, update_flag), - Tab::CAMERA => Self::camera_tab(ui, state, update_flag), - Tab::CONFIG => Self::config_tab(ui, state, emulator, update_flag), - Tab::INFO => Self::info_tab(ui, state, emulator, update_flag), + Tab::Slice => Self::slice_tab(ui, state, update_flag), + Tab::Camera => Self::camera_tab(ui, state, update_flag), + Tab::Config => Self::config_tab(ui, state, emulator, update_flag), + Tab::Info => Self::info_tab(ui, state, emulator, update_flag), } ui.separator(); diff --git a/simulator/src/renderer/mod.rs b/simulator/src/renderer/mod.rs index 5e09f22..7389dc2 100644 --- a/simulator/src/renderer/mod.rs +++ b/simulator/src/renderer/mod.rs @@ -295,7 +295,7 @@ impl Renderer { let view_proj = Self::proj_view(camera, state, window); self.transducer_renderer.resize(view_proj, queue); self.slice_renderer.resize(view_proj, queue); - self.depth_texture = DepthTexture::new(device, &surface_config); + self.depth_texture = DepthTexture::new(device, surface_config); } } diff --git a/simulator/src/simulator.rs b/simulator/src/simulator.rs index 886b3e4..e3ac67f 100644 --- a/simulator/src/simulator.rs +++ b/simulator/src/simulator.rs @@ -136,8 +136,8 @@ impl Simulator { let system_time = self.state.system_time(); self.emulator.update(system_time); - match event { - Some(UserEvent::Server(signal)) => match signal { + if let Some(UserEvent::Server(signal)) = event { + match signal { crate::event::Signal::ConfigGeometry(geometry) => { self.emulator.initialize(geometry); self.renderer.as_mut().unwrap().initialize(&self.emulator); @@ -170,8 +170,7 @@ impl Simulator { self.state.port ); } - }, - _ => {} + } } } diff --git a/simulator/src/state/mod.rs b/simulator/src/state/mod.rs index ab40152..6c15ea5 100644 --- a/simulator/src/state/mod.rs +++ b/simulator/src/state/mod.rs @@ -52,10 +52,10 @@ impl SliceState { #[derive(Debug, PartialEq, Default, Clone, Serialize, Deserialize)] pub enum Tab { #[default] - SLICE, - CAMERA, - CONFIG, - INFO, + Slice, + Camera, + Config, + Info, } #[derive(Serialize, Deserialize)]