From 02e1763e1d2c2e273da2106722d735ebe0645df4 Mon Sep 17 00:00:00 2001 From: biroder <107300789+biroder@users.noreply.github.com> Date: Wed, 5 Jul 2023 11:58:54 +0300 Subject: [PATCH] Fix a couple of warnings[ci skip] --- src/game/mod.rs | 27 +++++++++++++-------------- src/game/shared_game_state.rs | 1 + 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/game/mod.rs b/src/game/mod.rs index f271a75..04b338e 100644 --- a/src/game/mod.rs +++ b/src/game/mod.rs @@ -218,14 +218,19 @@ impl Game { // one or deinited(so we can't create the console-only logger and replace it by the // console&file logger after FilesystemContainer has been initialized) fn get_logs_dir() -> GameResult { - let mut logs_dir = PathBuf::new(); - - + let mut logs_dir: PathBuf; + + #[cfg(target_os = "android")] { logs_dir = PathBuf::from(ndk_glue::native_activity().internal_data_path().to_string_lossy().to_string()); } - + + #[cfg(target_os = "horizon")] + { + logs_dir = PathBuf::from("sdmc:/switch/doukutsu-rs"); + } + #[cfg(not(any(target_os = "android", target_os = "horizon")))] { let project_dirs = match directories::ProjectDirs::from("", "", "doukutsu-rs") { @@ -237,19 +242,13 @@ fn get_logs_dir() -> GameResult { ))); } }; - + logs_dir = project_dirs.data_local_dir().to_path_buf(); } - - #[cfg(target_os = "horizon")] - { - logs_dir = PathBuf::from("sdmc:/switch/doukutsu-rs"); - } - - - + logs_dir.push("logs"); - + + Ok(logs_dir) } diff --git a/src/game/shared_game_state.rs b/src/game/shared_game_state.rs index c745b2d..6f2c416 100644 --- a/src/game/shared_game_state.rs +++ b/src/game/shared_game_state.rs @@ -451,6 +451,7 @@ impl SharedGameState { let more_rust = (current_time.month() == 7 && current_time.day() == 7) || settings.more_rust; let seed = chrono::Local::now().timestamp() as i32; + #[cfg(feature = "discord-rpc")] let discord_rpc_app_id = match option_env!("DISCORD_RPC_APP_ID") { Some(app_id) => app_id, None => "1076523467337367622",