From efe8e523a9fce1487342c7cfeddd31a26246b74c Mon Sep 17 00:00:00 2001 From: GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> Date: Mon, 5 Dec 2022 18:09:13 +0100 Subject: refactor: Move variable to global const (#85) Makes it easier to update/re-use in the future Co-authored-by: Remy Raes --- src-tauri/src/mod_management/mod.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src-tauri/src/mod_management') diff --git a/src-tauri/src/mod_management/mod.rs b/src-tauri/src/mod_management/mod.rs index b8d210ff..b17e98a6 100644 --- a/src-tauri/src/mod_management/mod.rs +++ b/src-tauri/src/mod_management/mod.rs @@ -10,6 +10,12 @@ use app::GameInstall; use json5; +pub const BLACKLISTED_MODS: [&str; 3] = [ + "northstar-Northstar", + "northstar-NorthstarReleaseCandidate", + "ebkr-r2modman", +]; + /// Gets all currently installed and enabled/disabled mods to rebuild `enabledmods.json` pub fn rebuild_enabled_mods_json(game_install: GameInstall) -> Result<(), String> { let enabledmods_json_path = format!("{}/R2Northstar/enabledmods.json", game_install.game_path); @@ -317,12 +323,7 @@ pub async fn fc_download_mod_and_install( // Prevent installing Northstar as a mod // While it would fail during install anyway, having explicit error message is nicer - let blacklisted_mods = [ - "northstar-Northstar", - "northstar-NorthstarReleaseCandidate", - "ebkr-r2modman", - ]; - for blacklisted_mod in blacklisted_mods { + for blacklisted_mod in BLACKLISTED_MODS { if thunderstore_mod_string.contains(blacklisted_mod) { return Err("Cannot install Northstar as a mod!".to_string()); } -- cgit v1.2.3