aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src/northstar/mod.rs
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2022-11-27 20:35:11 +0100
committerGitHub <noreply@github.com>2022-11-27 20:35:11 +0100
commit8d40bca06dc8eea63c5eb7e4ae93f38e29654c7b (patch)
treeaa34f767f23150aa9c72cd13b7fa2543f0dc37f4 /src-tauri/src/northstar/mod.rs
parent516bbf8830b6038018666a7cc87684eed5f1e6aa (diff)
downloadFlightCore-8d40bca06dc8eea63c5eb7e4ae93f38e29654c7b.tar.gz
FlightCore-8d40bca06dc8eea63c5eb7e4ae93f38e29654c7b.zip
refactor: Make var containing core mods pub const (#74)
This way we only define them in one place
Diffstat (limited to 'src-tauri/src/northstar/mod.rs')
-rw-r--r--src-tauri/src/northstar/mod.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/src-tauri/src/northstar/mod.rs b/src-tauri/src/northstar/mod.rs
index a7ec044a..8adfeec2 100644
--- a/src-tauri/src/northstar/mod.rs
+++ b/src-tauri/src/northstar/mod.rs
@@ -1,6 +1,12 @@
//! This module deals with handling things around Northstar such as
//! - getting version number
+pub const CORE_MODS: [&str; 3] = [
+ "Northstar.Client",
+ "Northstar.Custom",
+ "Northstar.CustomServers",
+];
+
use crate::check_mod_version_number;
use anyhow::anyhow;
@@ -12,20 +18,15 @@ pub fn get_northstar_version_number(game_path: String) -> Result<String, anyhow:
// TODO:
// Check if NorthstarLauncher.exe exists and check its version number
let profile_folder = "R2Northstar";
- let core_mods = [
- "Northstar.Client",
- "Northstar.Custom",
- "Northstar.CustomServers",
- ];
let initial_version_number = match check_mod_version_number(format!(
"{}/{}/mods/{}",
- game_path, profile_folder, core_mods[0]
+ game_path, profile_folder, CORE_MODS[0]
)) {
Ok(version_number) => version_number,
Err(err) => return Err(err),
};
- for core_mod in core_mods {
+ for core_mod in CORE_MODS {
let current_version_number = match check_mod_version_number(format!(
"{}/{}/mods/{}",
game_path, profile_folder, core_mod