aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src/lib.rs
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2023-01-31 00:56:01 +0100
committerGitHub <noreply@github.com>2023-01-31 00:56:01 +0100
commit9dd72777f685b98951b13020d5bb303549c79161 (patch)
treea73f5ef2cdbd593cf322db847722c0ee9ac0c43f /src-tauri/src/lib.rs
parent637d39e37508f046d9dce012b2fed15dff14364f (diff)
downloadFlightCore-9dd72777f685b98951b13020d5bb303549c79161.tar.gz
FlightCore-9dd72777f685b98951b13020d5bb303549c79161.zip
refactor: Remove unnecessary use of anyhow (#150)
Diffstat (limited to 'src-tauri/src/lib.rs')
-rw-r--r--src-tauri/src/lib.rs4
1 files 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<GameInstall, String> {
}
/// 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(())
}