From c3c1aab86e7254f8f1724f3e13a4f17a9974f422 Mon Sep 17 00:00:00 2001 From: GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> Date: Fri, 13 Oct 2023 01:49:50 +0200 Subject: refactor: Use fully qualified path for vars and funcs (#614) * refactor: Use fully qualified path for variable Instead of importing it directly * refactor: Use fully-qualified path for Linux specific function --- src-tauri/src/main.rs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 47cfee6a..e37f118e 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -9,8 +9,7 @@ use std::{ time::Duration, }; -use crate::constants::REFRESH_DELAY; - +mod constants; mod development; mod github; mod mod_management; @@ -103,7 +102,7 @@ fn main() { let app_handle = app.app_handle(); tauri::async_runtime::spawn(async move { loop { - sleep(REFRESH_DELAY).await; + sleep(constants::REFRESH_DELAY).await; app_handle .emit_all( "northstar-statistics", @@ -453,13 +452,8 @@ async fn get_available_northstar_versions() -> Result Result<(), String> { // check `ldd --version` to see if glibc is up to date for northstar proton let min_required_ldd_version = 2.33; - let lddv = linux::check_glibc_v(); + let lddv = platform_specific::linux::check_glibc_v(); if lddv < min_required_ldd_version { return Err(format!( "GLIBC is not version {} or greater", @@ -532,7 +526,7 @@ fn get_host_os() -> String { #[tauri::command] async fn install_northstar_proton_wrapper() -> Result<(), String> { #[cfg(target_os = "linux")] - return linux::install_ns_proton().map_err(|err| err.to_string()); + return platform_specific::linux::install_ns_proton().map_err(|err| err.to_string()); #[cfg(target_os = "windows")] Err("Not supported on Windows".to_string()) @@ -541,7 +535,7 @@ async fn install_northstar_proton_wrapper() -> Result<(), String> { #[tauri::command] async fn uninstall_northstar_proton_wrapper() -> Result<(), String> { #[cfg(target_os = "linux")] - return linux::uninstall_ns_proton(); + return platform_specific::linux::uninstall_ns_proton(); #[cfg(target_os = "windows")] Err("Not supported on Windows".to_string()) @@ -550,7 +544,7 @@ async fn uninstall_northstar_proton_wrapper() -> Result<(), String> { #[tauri::command] async fn get_local_northstar_proton_wrapper_version() -> Result { #[cfg(target_os = "linux")] - return linux::get_local_ns_proton_version(); + return platform_specific::linux::get_local_ns_proton_version(); #[cfg(target_os = "windows")] Err("Not supported on Windows".to_string()) -- cgit v1.2.3