diff options
author | cat_or_not <41955154+catornot@users.noreply.github.com> | 2023-04-16 15:55:09 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-16 21:55:09 +0200 |
commit | c106e8ac0eafdbb1c7c549f93f7e8ad0d3cd558c (patch) | |
tree | 7b9a3f2ce86687b166411c4b72cd8e1f80a041c7 /src-tauri/src/main.rs | |
parent | d1d6c3001d0066d4774d4b92560f6098f78e689b (diff) | |
download | FlightCore-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/main.rs')
-rw-r--r-- | src-tauri/src/main.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 76e8833e..3aa17459 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -202,7 +202,7 @@ async fn get_flightcore_version_number() -> String { #[tauri::command] async fn get_northstar_version_number_caller(game_path: String) -> Result<String, String> { - match get_northstar_version_number(game_path) { + match get_northstar_version_number(&game_path) { Ok(version_number) => Ok(version_number), Err(err) => Err(err.to_string()), } @@ -234,7 +234,7 @@ async fn check_is_northstar_outdated( .expect("Couldn't find Northstar on thunderstore???"); // .ok_or_else(|| anyhow!("Couldn't find Northstar on thunderstore???"))?; - let version_number = match get_northstar_version_number(game_path) { + let version_number = match get_northstar_version_number(&game_path) { Ok(version_number) => version_number, Err(err) => { log::warn!("{}", err); @@ -323,7 +323,7 @@ async fn launch_northstar_caller( game_install: GameInstall, bypass_checks: Option<bool>, ) -> Result<String, String> { - launch_northstar(game_install, bypass_checks) + launch_northstar(&game_install, bypass_checks) } #[tauri::command] @@ -332,7 +332,7 @@ async fn launch_northstar_steam_caller( game_install: GameInstall, bypass_checks: Option<bool>, ) -> Result<String, String> { - launch_northstar_steam(game_install, bypass_checks) + launch_northstar_steam(&game_install, bypass_checks) } #[tauri::command] @@ -341,8 +341,8 @@ async fn install_mod_caller( game_install: GameInstall, thunderstore_mod_string: String, ) -> Result<(), String> { - fc_download_mod_and_install(game_install.clone(), thunderstore_mod_string).await?; - match clean_up_download_folder(game_install, false) { + fc_download_mod_and_install(&game_install, &thunderstore_mod_string).await?; + match clean_up_download_folder(&game_install, false) { Ok(()) => Ok(()), Err(err) => { log::info!("Failed to delete download folder due to {}", err); @@ -359,7 +359,7 @@ async fn clean_up_download_folder_caller( game_install: GameInstall, force: bool, ) -> Result<(), String> { - match clean_up_download_folder(game_install, force) { + match clean_up_download_folder(&game_install, force) { Ok(()) => Ok(()), Err(err) => Err(err.to_string()), } |