aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src/lib.rs
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2022-11-02 21:26:03 +0100
committerGitHub <noreply@github.com>2022-11-02 21:26:03 +0100
commitd8232fa953a08aafce71e0bc9823c554eed59d7c (patch)
tree27e8376f84486e426d6f3ac44a592bf9f14e31cf /src-tauri/src/lib.rs
parent4e0323020a794139bf3c809a9a70d87be3f2885c (diff)
downloadFlightCore-d8232fa953a08aafce71e0bc9823c554eed59d7c.tar.gz
FlightCore-d8232fa953a08aafce71e0bc9823c554eed59d7c.zip
refactor: Return error string instead of anyhow!() (#36)
All that is returned as the error type is a string so there's no point in using a custom error type when we can just have the error type be a string. Co-authored-by: Remy Raes <contact@remyraes.com>
Diffstat (limited to 'src-tauri/src/lib.rs')
-rw-r--r--src-tauri/src/lib.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index cfc5fb57..5d8d55e6 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -72,7 +72,7 @@ pub fn linux_checks_librs() -> Result<(), String> {
}
/// Attempts to find the game install location
-pub fn find_game_install_location() -> Result<GameInstall, anyhow::Error> {
+pub fn find_game_install_location() -> Result<GameInstall, String> {
// Attempt parsing Steam library directly
match steamlocate::SteamDir::locate() {
Some(mut steamdir) => {
@@ -107,9 +107,7 @@ pub fn find_game_install_location() -> Result<GameInstall, anyhow::Error> {
}
};
- Err(anyhow!(
- "Could not auto-detect game install location! Please enter it manually."
- ))
+ Err("Could not auto-detect game install location! Please enter it manually.".to_string())
}
/// Returns the current Northstar version number as a string