From 19b1ade7584ebc9f25113aabce9aeec3f6e9f026 Mon Sep 17 00:00:00 2001 From: futile Date: Fri, 18 Apr 2025 00:59:07 +0100 Subject: [PATCH] remove 1 `to_string` and replace some others with `to_owned` --- src/features/force_close.rs | 4 ++-- src/features/game_networking.rs | 2 +- src/gui/app.rs | 2 +- src/gui/run.rs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/features/force_close.rs b/src/features/force_close.rs index e1b4d89..d21fea7 100644 --- a/src/features/force_close.rs +++ b/src/features/force_close.rs @@ -12,7 +12,7 @@ pub struct ForceClose { impl Default for ForceClose { fn default() -> Self { Self { - button_text: "Force close game".to_string(), + button_text: "Force close game".to_owned(), prompting: false, interval: Instant::now(), } @@ -21,7 +21,7 @@ impl Default for ForceClose { impl ForceClose { pub fn prompting(&mut self) { - self.button_text = "Are you sure?".to_string(); + self.button_text = "Are you sure?".to_owned(); self.prompting = true; self.interval = Instant::now(); } diff --git a/src/features/game_networking.rs b/src/features/game_networking.rs index 3bab108..e54de3f 100644 --- a/src/features/game_networking.rs +++ b/src/features/game_networking.rs @@ -24,7 +24,7 @@ pub fn block_all(sysinfo: &mut System) { let Some(exe_path) = get_game_exe_path(sysinfo) else { return; }; - let exe_path = exe_path.display().to_string(); + let exe_path = exe_path.display(); Command::new("netsh") .args([ "advfirewall", diff --git a/src/gui/app.rs b/src/gui/app.rs index e192516..45de062 100644 --- a/src/gui/app.rs +++ b/src/gui/app.rs @@ -315,7 +315,7 @@ impl App { .iter() .find(|(_, p)| p.name() == ENHANCED || p.name() == LEGACY) .map_or_else( - || "no pid found!".to_string(), + || "no pid found!".to_owned(), |(pid, _)| pid.as_u32().to_string(), ); ui.label(format!("gta pid: {pid}")); diff --git a/src/gui/run.rs b/src/gui/run.rs index 7ae8201..1753e5c 100644 --- a/src/gui/run.rs +++ b/src/gui/run.rs @@ -43,12 +43,12 @@ fn app_creator( }); let mut fonts = egui::FontDefinitions::default(); fonts.font_data.insert( - "Ubuntu-Regular".to_string(), + "Ubuntu-Regular".to_owned(), egui::FontData::from_static(include_bytes!("../../assets/Ubuntu-Regular.ttf")).into(), ); fonts.families.insert( egui::FontFamily::Name("Ubuntu-Regular".into()), - vec!["Ubuntu-Regular".to_string()], + vec!["Ubuntu-Regular".to_owned()], ); cc.egui_ctx.set_fonts(fonts); Ok(app)