aboutsummaryrefslogtreecommitdiff
path: root/src-tauri
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2022-11-11 12:15:30 +0100
committerGitHub <noreply@github.com>2022-11-11 12:15:30 +0100
commit128c9af70f92703589894971769230075bc09e96 (patch)
tree351160c8a1bdbf705c7fdf1598e9b1d78f74b8fc /src-tauri
parentdb569f94c2dc461ee17fcebd083a46aa20fb06f6 (diff)
downloadFlightCore-128c9af70f92703589894971769230075bc09e96.tar.gz
FlightCore-128c9af70f92703589894971769230075bc09e96.zip
refactor: Return Result<> for getting NS version (#46)
as opposed to using an empty string to indicate an error.
Diffstat (limited to 'src-tauri')
-rw-r--r--src-tauri/src/main.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index 0210cabb..ad5842f4 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -146,13 +146,10 @@ async fn get_flightcore_version_number() -> String {
}
#[tauri::command]
-async fn get_northstar_version_number_caller(game_path: String) -> String {
+async fn get_northstar_version_number_caller(game_path: String) -> Result<String, String> {
match get_northstar_version_number(game_path) {
- Ok(version_number) => version_number,
- Err(err) => {
- println!("{}", err);
- "".to_string()
- }
+ Ok(version_number) => Ok(version_number),
+ Err(err) => Err(err.to_string()),
}
}