fix: replace impl Default with derive Default

This commit is contained in:
mostafaei2002 2024-06-10 14:46:23 +03:30
parent 4f44025d5b
commit b260f364e1
2 changed files with 8 additions and 28 deletions

View file

@ -243,8 +243,9 @@ pub struct Xmrig {
pub token: String, pub token: String,
} }
#[derive(Clone, Eq, PartialEq, Debug, Deserialize, Serialize)] #[derive(Clone, Eq, PartialEq, Debug, Deserialize, Serialize, Default)]
pub enum XvbMode { pub enum XvbMode {
#[default]
Auto, Auto,
ManuallyDonate, ManuallyDonate,
ManuallyKeep, 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 { pub enum ManualDonationLevel {
#[default]
Donor, Donor,
DonorVIP, DonorVIP,
DonorWhale, DonorWhale,
@ -396,16 +398,4 @@ impl Default for Version {
xmrig: XMRIG_VERSION.to_string(), xmrig: XMRIG_VERSION.to_string(),
} }
} }
}
impl Default for XvbMode {
fn default() -> Self {
Self::Auto
}
}
impl Default for ManualDonationLevel {
fn default() -> Self {
Self::Donor
}
} }

View file

@ -17,8 +17,9 @@ use crate::disk::state::XvbMode;
use super::{nodes::XvbNode, rounds::XvbRound, PubXvbApi}; use super::{nodes::XvbNode, rounds::XvbRound, PubXvbApi};
#[derive(Debug, Clone, Deserialize, PartialEq, Eq)] #[derive(Debug, Clone, Deserialize, PartialEq, Eq, Default)]
pub enum RuntimeMode { pub enum RuntimeMode {
#[default]
Auto, Auto,
ManuallyDonate, ManuallyDonate,
ManuallyKeep, ManuallyKeep,
@ -27,8 +28,9 @@ pub enum RuntimeMode {
} }
#[derive(Debug, Clone, Deserialize, PartialEq, Eq)] #[derive(Debug, Clone, Deserialize, PartialEq, Eq, Default)]
pub enum RuntimeDonationLevel { pub enum RuntimeDonationLevel {
#[default]
Donor, Donor,
DonorVIP, DonorVIP,
DonorWhale, DonorWhale,
@ -151,15 +153,3 @@ impl From<ManualDonationLevel> for RuntimeDonationLevel {
} }
} }
} }
impl Default for RuntimeMode {
fn default() -> Self {
Self::Auto
}
}
impl Default for RuntimeDonationLevel {
fn default() -> Self {
Self::Donor
}
}