From 6b5afd26fabb7175c50b47ded10fe9b682d952d6 Mon Sep 17 00:00:00 2001 From: Cyrix126 Date: Mon, 20 May 2024 12:57:22 +0200 Subject: [PATCH] fix warnings windows --- src/components/update.rs | 14 +++++--------- src/disk/mod.rs | 8 ++++---- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/components/update.rs b/src/components/update.rs index d86623a..b3c6fa5 100644 --- a/src/components/update.rs +++ b/src/components/update.rs @@ -180,14 +180,12 @@ pub fn check_xmrig_path(path: &str) -> bool { #[derive(Clone)] pub struct Update { - pub path_gupax: String, // Full path to current gupax - pub path_p2pool: String, // Full path to current p2pool - pub path_xmrig: String, // Full path to current xmrig - #[cfg(target_os = "windows")] - pub tmp_dir: String, // Full path to temporary directory + pub path_gupax: String, // Full path to current gupax + pub path_p2pool: String, // Full path to current p2pool + pub path_xmrig: String, // Full path to current xmrig pub updating: Arc>, // Is an update in progress? - pub prog: Arc>, // Holds the 0-100% progress bar number - pub msg: Arc>, // Message to display on [Gupax] tab while updating + pub prog: Arc>, // Holds the 0-100% progress bar number + pub msg: Arc>, // Message to display on [Gupax] tab while updating } impl Update { @@ -197,8 +195,6 @@ impl Update { path_gupax, path_p2pool: path_p2pool.display().to_string(), path_xmrig: path_xmrig.display().to_string(), - #[cfg(target_os = "windows")] - tmp_dir: "".to_string(), updating: arc_mut!(false), prog: arc_mut!(0.0), msg: arc_mut!(MSG_NONE.to_string()), diff --git a/src/disk/mod.rs b/src/disk/mod.rs index cef5c3f..bc310c2 100644 --- a/src/disk/mod.rs +++ b/src/disk/mod.rs @@ -85,11 +85,8 @@ pub fn get_gupax_data_path() -> Result { } } } - +#[cfg(target_family = "unix")] pub fn set_unix_750_perms(path: &PathBuf) -> Result<(), TomlError> { - #[cfg(target_os = "windows")] - return Ok(()); - #[cfg(target_family = "unix")] match fs::set_permissions(path, fs::Permissions::from_mode(0o750)) { Ok(_) => { info!( @@ -124,6 +121,9 @@ pub fn create_gupax_dir(path: &PathBuf) -> Result<(), TomlError> { return Err(TomlError::Io(e)); } } + #[cfg(target_os = "windows")] + return Ok(()); + #[cfg(target_family = "unix")] set_unix_750_perms(path) }