From 9dd72777f685b98951b13020d5bb303549c79161 Mon Sep 17 00:00:00 2001 From: GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> Date: Tue, 31 Jan 2023 00:56:01 +0100 Subject: refactor: Remove unnecessary use of anyhow (#150) --- src-tauri/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 67f42f85..62cc07ae 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -124,14 +124,14 @@ pub fn find_game_install_location() -> Result { } /// Checks whether the provided path is a valid Titanfall2 gamepath by checking against a certain set of criteria -pub fn check_is_valid_game_path(game_install_path: &str) -> Result<(), anyhow::Error> { +pub fn check_is_valid_game_path(game_install_path: &str) -> Result<(), String> { let path_to_titanfall2_exe = format!("{}/Titanfall2.exe", game_install_path); let is_correct_game_path = 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 if !is_correct_game_path { - return Err(anyhow!("Incorrect game path \"{}\"", game_install_path)); // Return error cause wrong game path + return Err(format!("Incorrect game path \"{}\"", game_install_path)); // Return error cause wrong game path } Ok(()) } -- cgit v1.2.3