From cf3a738a763013ba3fd6921c5cc9352b923162ff Mon Sep 17 00:00:00 2001 From: Anas Elgarhy Date: Thu, 23 Feb 2023 11:22:38 +0200 Subject: [PATCH] Update settings to use const instead of pub const --- src/settings.rs | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/src/settings.rs b/src/settings.rs index 4c0d5d6..37ad9c7 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -3,29 +3,30 @@ use clap::Parser; use log::{debug, info}; use serde::{Deserialize, Serialize}; -pub const NOTIFICATION_TIMEOUT: u8 = 5; -pub const NOTIFICATION_BODY: &str = +const NOTIFICATION_TIMEOUT: u8 = 5; +const NOTIFICATION_BODY: &str = "Playing: {title} \n album: {album} \n Artist: {artist} - {date}"; -pub const NOTIFICATION_SUMMARY: &str = "{title}"; -pub const NOTIFICATION_APP_NAME: &str = "C* Music Player"; -pub const DEFAULT_REMOTE_COMMAND: &str = "cmus-remote"; -pub const DEFAULT_MAX_DEPTH: u8 = 3; -pub const DEFAULT_INTERVAL_TIME: u64 = 1000; // 1000 ms -pub const DEFAULT_STATUS_CHANGE_NOTIFICATION_BODY: &str = "{status}"; -pub const DEFAULT_STATUS_CHANGE_NOTIFICATION_SUMMARY: &str = "Status changed"; -pub const DEFAULT_STATUS_CHANGE_NOTIFICATION_TIMEOUT: u8 = 1; -pub const DEFAULT_VOLUME_CHANGE_NOTIFICATION_BODY: &str = "Volume changed to {volume}%"; -pub const DEFAULT_VOLUME_CHANGE_NOTIFICATION_SUMMARY: &str = "Volume changed"; -pub const DEFAULT_VOLUME_CHANGE_NOTIFICATION_TIMEOUT: u8 = 1; -pub const DEFAULT_SHUFFLE_NOTIFICATION_BODY: &str = "Shuffle mode changed to {shuffle}"; -pub const DEFAULT_SHUFFLE_NOTIFICATION_SUMMARY: &str = "Shuffle mode changed"; -pub const DEFAULT_SHUFFLE_NOTIFICATION_TIMEOUT: u8 = 1; -pub const DEFAULT_REPEAT_NOTIFICATION_BODY: &str = "Repeat mode changed to {repeat}"; -pub const DEFAULT_REPEAT_NOTIFICATION_SUMMARY: &str = "Repeat mode changed"; -pub const DEFAULT_REPEAT_NOTIFICATION_TIMEOUT: u8 = 1; -pub const DEFAULT_AAAMODE_NOTIFICATION_BODY: &str = "AAA mode changed to {aaa_mode}"; -pub const DEFAULT_AAAMODE_NOTIFICATION_SUMMARY: &str = "AAA mode changed"; -pub const DEFAULT_AAAMODE_NOTIFICATION_TIMEOUT: u8 = 1; +const NOTIFICATION_SUMMARY: &str = "{title}"; +const NOTIFICATION_APP_NAME: &str = "C* Music Player"; +const DEFAULT_REMOTE_COMMAND: &str = "cmus-remote"; +const DEFAULT_MAX_DEPTH: u8 = 3; +const DEFAULT_INTERVAL_TIME: u64 = 1000; +// 1000 ms +const DEFAULT_STATUS_CHANGE_NOTIFICATION_BODY: &str = "{status}"; +const DEFAULT_STATUS_CHANGE_NOTIFICATION_SUMMARY: &str = "Status changed"; +const DEFAULT_STATUS_CHANGE_NOTIFICATION_TIMEOUT: u8 = 1; +const DEFAULT_VOLUME_CHANGE_NOTIFICATION_BODY: &str = "Volume changed to {volume}%"; +const DEFAULT_VOLUME_CHANGE_NOTIFICATION_SUMMARY: &str = "Volume changed"; +const DEFAULT_VOLUME_CHANGE_NOTIFICATION_TIMEOUT: u8 = 1; +const DEFAULT_SHUFFLE_NOTIFICATION_BODY: &str = "Shuffle mode changed to {shuffle}"; +const DEFAULT_SHUFFLE_NOTIFICATION_SUMMARY: &str = "Shuffle mode changed"; +const DEFAULT_SHUFFLE_NOTIFICATION_TIMEOUT: u8 = 1; +const DEFAULT_REPEAT_NOTIFICATION_BODY: &str = "Repeat mode changed to {repeat}"; +const DEFAULT_REPEAT_NOTIFICATION_SUMMARY: &str = "Repeat mode changed"; +const DEFAULT_REPEAT_NOTIFICATION_TIMEOUT: u8 = 1; +const DEFAULT_AAAMODE_NOTIFICATION_BODY: &str = "AAA mode changed to {aaa_mode}"; +const DEFAULT_AAAMODE_NOTIFICATION_SUMMARY: &str = "AAA mode changed"; +const DEFAULT_AAAMODE_NOTIFICATION_TIMEOUT: u8 = 1; #[cfg(feature = "lyrics")] const DEFAULT_LYRICS_NOTIFICATION_BODY: &str = "{lyrics}"; #[cfg(feature = "lyrics")]