aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src/main.rs
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2022-10-19 15:40:22 +0200
committerGitHub <noreply@github.com>2022-10-19 15:40:22 +0200
commit6365220063527735fca0134f0649b97d82525990 (patch)
tree822d28793cdb757507e9d30a66f1cc56cc852f35 /src-tauri/src/main.rs
parent4e55dce30214a426c8621c565f525303b43fbf7f (diff)
downloadFlightCore-6365220063527735fca0134f0649b97d82525990.tar.gz
FlightCore-6365220063527735fca0134f0649b97d82525990.zip
refactor: Use `Result<>` return type for Linux checks (#21)
* refactor: Use result return type for Linux checks * refactor: Store min required ldd version in const This way we only need to update a single variable in case min required version changes.
Diffstat (limited to 'src-tauri/src/main.rs')
-rw-r--r--src-tauri/src/main.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index a33f836c..411e75c9 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -120,12 +120,13 @@ fn is_debug_mode() -> bool {
#[tauri::command]
/// Returns true if linux compatible
-fn linux_checks() -> bool {
- if get_host_os() == "windows" {
- false
- } else {
- linux_checks_librs()
+fn linux_checks() -> Result<(), String> {
+ // Early return if Windows
+ if get_host_os() == "windows" {
+ return Err("Not available on Windows".to_string());
}
+
+ linux_checks_librs()
}
#[tauri::command]