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,
}
#[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,
@ -397,15 +399,3 @@ impl Default for Version {
}
}
}
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};
#[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<ManualDonationLevel> for RuntimeDonationLevel {
}
}
}
impl Default for RuntimeMode {
fn default() -> Self {
Self::Auto
}
}
impl Default for RuntimeDonationLevel {
fn default() -> Self {
Self::Donor
}
}