From b325ebb03cae68f3a1670e79d46b1f50797cc2f0 Mon Sep 17 00:00:00 2001 From: futile Date: Sun, 4 May 2025 18:21:55 +0100 Subject: [PATCH] clippy stuff --- src/features/force_close.rs | 2 +- src/gui/debug.rs | 2 +- src/util/consts.rs | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/features/force_close.rs b/src/features/force_close.rs index 7cb5b1b..605e5ca 100644 --- a/src/features/force_close.rs +++ b/src/features/force_close.rs @@ -44,7 +44,7 @@ impl ForceClose { *self = Self::default(); } - fn finish_current_frame(&mut self) { + const fn finish_current_frame(&mut self) { if self.current_frame { self.current_frame = false; } diff --git a/src/gui/debug.rs b/src/gui/debug.rs index 679ab9d..e5a782e 100644 --- a/src/gui/debug.rs +++ b/src/gui/debug.rs @@ -37,7 +37,7 @@ impl App { ui.horizontal(|ui| { ui.label("blocked_status"); egui::ComboBox::from_id_salt("blocked_status") - .selected_text(&self.game_networking.blocked_status.to_string()) + .selected_text(self.game_networking.blocked_status.to_string()) .show_ui(ui, |ui| { ui.build_menu(&mut self.game_networking.blocked_status); }); diff --git a/src/util/consts.rs b/src/util/consts.rs index 5371f5d..324b907 100644 --- a/src/util/consts.rs +++ b/src/util/consts.rs @@ -1,7 +1,8 @@ use std::{env, path::PathBuf, sync::LazyLock}; -pub static APP_STORAGE_PATH: LazyLock = - LazyLock::new(|| PathBuf::from(env::var("LOCALAPPDATA").unwrap()).join("GTA Tools")); +pub static APP_STORAGE_PATH: LazyLock = LazyLock::new(|| { + PathBuf::from(env::var("LOCALAPPDATA").unwrap_or_else(|_| String::from("."))).join("GTA Tools") +}); pub mod game { pub const EXE_ENHANCED: &str = "GTA5_Enhanced.exe";