From f6bc90dfc7242f7652cda2edb7cad2ff335c0b7b Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Sat, 10 Sep 2022 11:17:26 +0200 Subject: Store format string in variable before use --- src-tauri/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src-tauri/src') diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 5eb19b5b..edf39842 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -88,8 +88,9 @@ pub fn get_northstar_version_number(game_path: String) -> Result Result<(), anyhow::Error> { + let path_to_titanfall2_exe = format!("{}/Titanfall2.exe", game_install_path); let is_correct_game_path = - std::path::Path::new(&format!("{}/Titanfall2.exe", game_install_path)).exists(); + std::path::Path::new(&path_to_titanfall2_exe).exists(); println!("Titanfall2.exe exists in path? {}", is_correct_game_path); // Exit early if wrong game path -- cgit v1.2.3