diff --git a/src/disk/state.rs b/src/disk/state.rs index 7b174f3..744eec9 100644 --- a/src/disk/state.rs +++ b/src/disk/state.rs @@ -243,8 +243,9 @@ pub struct Xmrig { pub token: String, } -#[derive(Clone, Eq, PartialEq, Debug, Deserialize, Serialize)] +#[derive(Clone, Eq, PartialEq, Debug, Deserialize, Serialize, Default)] pub enum XvbMode { + #[default] Auto, ManuallyDonate, ManuallyKeep, @@ -253,8 +254,9 @@ pub enum XvbMode { } -#[derive(Clone, Eq, PartialEq, Debug, Deserialize, Serialize)] +#[derive(Clone, Eq, PartialEq, Debug, Deserialize, Serialize, Default)] pub enum ManualDonationLevel { + #[default] Donor, DonorVIP, DonorWhale, @@ -396,16 +398,4 @@ impl Default for Version { xmrig: XMRIG_VERSION.to_string(), } } -} - -impl Default for XvbMode { - fn default() -> Self { - Self::Auto - } -} - -impl Default for ManualDonationLevel { - fn default() -> Self { - Self::Donor - } } \ No newline at end of file diff --git a/src/helper/xvb/priv_stats.rs b/src/helper/xvb/priv_stats.rs index 7b353cd..9243fbc 100644 --- a/src/helper/xvb/priv_stats.rs +++ b/src/helper/xvb/priv_stats.rs @@ -17,8 +17,9 @@ use crate::disk::state::XvbMode; use super::{nodes::XvbNode, rounds::XvbRound, PubXvbApi}; -#[derive(Debug, Clone, Deserialize, PartialEq, Eq)] +#[derive(Debug, Clone, Deserialize, PartialEq, Eq, Default)] pub enum RuntimeMode { + #[default] Auto, ManuallyDonate, ManuallyKeep, @@ -27,8 +28,9 @@ pub enum RuntimeMode { } -#[derive(Debug, Clone, Deserialize, PartialEq, Eq)] +#[derive(Debug, Clone, Deserialize, PartialEq, Eq, Default)] pub enum RuntimeDonationLevel { + #[default] Donor, DonorVIP, DonorWhale, @@ -151,15 +153,3 @@ impl From for RuntimeDonationLevel { } } } - -impl Default for RuntimeMode { - fn default() -> Self { - Self::Auto - } -} - -impl Default for RuntimeDonationLevel { - fn default() -> Self { - Self::Donor - } -} \ No newline at end of file