aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src/northstar
diff options
context:
space:
mode:
authorcat_or_not <41955154+catornot@users.noreply.github.com>2023-04-16 15:55:09 -0400
committerGitHub <noreply@github.com>2023-04-16 21:55:09 +0200
commitc106e8ac0eafdbb1c7c549f93f7e8ad0d3cd558c (patch)
tree7b9a3f2ce86687b166411c4b72cd8e1f80a041c7 /src-tauri/src/northstar
parentd1d6c3001d0066d4774d4b92560f6098f78e689b (diff)
downloadFlightCore-c106e8ac0eafdbb1c7c549f93f7e8ad0d3cd558c.tar.gz
FlightCore-c106e8ac0eafdbb1c7c549f93f7e8ad0d3cd558c.zip
Use pass-by-reference where possible (#266)
Use pass-by-reference where possible also contains some other small changes
Diffstat (limited to 'src-tauri/src/northstar')
-rw-r--r--src-tauri/src/northstar/mod.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/src-tauri/src/northstar/mod.rs b/src-tauri/src/northstar/mod.rs
index f3f8cde3..7bd0b0a3 100644
--- a/src-tauri/src/northstar/mod.rs
+++ b/src-tauri/src/northstar/mod.rs
@@ -5,24 +5,23 @@ use crate::{check_mod_version_number, constants::CORE_MODS};
use anyhow::anyhow;
/// Returns the current Northstar version number as a string
-pub fn get_northstar_version_number(game_path: String) -> Result<String, anyhow::Error> {
+pub fn get_northstar_version_number(game_path: &str) -> Result<String, anyhow::Error> {
log::info!("{}", game_path);
// TODO:
// Check if NorthstarLauncher.exe exists and check its version number
let profile_folder = "R2Northstar";
- let initial_version_number = match check_mod_version_number(format!(
- "{}/{}/mods/{}",
- game_path, profile_folder, CORE_MODS[0]
+ let initial_version_number = match check_mod_version_number(&format!(
+ "{game_path}/{profile_folder}/mods/{}",
+ CORE_MODS[0]
)) {
Ok(version_number) => version_number,
Err(err) => return Err(err),
};
for core_mod in CORE_MODS {
- let current_version_number = match check_mod_version_number(format!(
- "{}/{}/mods/{}",
- game_path, profile_folder, core_mod
+ let current_version_number = match check_mod_version_number(&format!(
+ "{game_path}/{profile_folder}/mods/{core_mod}",
)) {
Ok(version_number) => version_number,
Err(err) => return Err(err),