chore: fix Rust 1.91.0 lint for derivable Default

This commit is contained in:
link2xt
2025-10-31 05:50:00 +00:00
committed by l
parent 08f8f488b1
commit 59959259bf
4 changed files with 8 additions and 27 deletions

View File

@@ -28,8 +28,9 @@ struct MozAutoconfigure {
pub outgoing_servers: Vec<Server>, pub outgoing_servers: Vec<Server>,
} }
#[derive(Debug)] #[derive(Debug, Default)]
enum MozConfigTag { enum MozConfigTag {
#[default]
Undefined, Undefined,
Hostname, Hostname,
Port, Port,
@@ -37,12 +38,6 @@ enum MozConfigTag {
Username, Username,
} }
impl Default for MozConfigTag {
fn default() -> Self {
Self::Undefined
}
}
impl FromStr for MozConfigTag { impl FromStr for MozConfigTag {
type Err = (); type Err = ();

View File

@@ -308,7 +308,7 @@ pub struct InnerContext {
} }
/// The state of ongoing process. /// The state of ongoing process.
#[derive(Debug)] #[derive(Debug, Default)]
enum RunningState { enum RunningState {
/// Ongoing process is allocated. /// Ongoing process is allocated.
Running { cancel_sender: Sender<()> }, Running { cancel_sender: Sender<()> },
@@ -317,15 +317,10 @@ enum RunningState {
ShallStop { request: tools::Time }, ShallStop { request: tools::Time },
/// There is no ongoing process, a new one can be allocated. /// There is no ongoing process, a new one can be allocated.
#[default]
Stopped, Stopped,
} }
impl Default for RunningState {
fn default() -> Self {
Self::Stopped
}
}
/// Return some info about deltachat-core /// Return some info about deltachat-core
/// ///
/// This contains information mostly about the library itself, the /// This contains information mostly about the library itself, the

View File

@@ -88,9 +88,10 @@ use crate::tools::{SystemTime, duration_to_str, time};
use crate::{location, stats}; use crate::{location, stats};
/// Ephemeral timer value. /// Ephemeral timer value.
#[derive(Debug, PartialEq, Eq, Copy, Clone, Serialize, Deserialize)] #[derive(Debug, PartialEq, Eq, Copy, Clone, Serialize, Deserialize, Default)]
pub enum Timer { pub enum Timer {
/// Timer is disabled. /// Timer is disabled.
#[default]
Disabled, Disabled,
/// Timer is enabled. /// Timer is enabled.
@@ -125,12 +126,6 @@ impl Timer {
} }
} }
impl Default for Timer {
fn default() -> Self {
Self::Disabled
}
}
impl fmt::Display for Timer { impl fmt::Display for Timer {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.to_u32()) write!(f, "{}", self.to_u32())

View File

@@ -381,9 +381,11 @@ impl rusqlite::types::FromSql for MsgId {
ToSql, ToSql,
Serialize, Serialize,
Deserialize, Deserialize,
Default,
)] )]
#[repr(u8)] #[repr(u8)]
pub(crate) enum MessengerMessage { pub(crate) enum MessengerMessage {
#[default]
No = 0, No = 0,
Yes = 1, Yes = 1,
@@ -391,12 +393,6 @@ pub(crate) enum MessengerMessage {
Reply = 2, Reply = 2,
} }
impl Default for MessengerMessage {
fn default() -> Self {
Self::No
}
}
/// An object representing a single message in memory. /// An object representing a single message in memory.
/// The message object is not updated. /// The message object is not updated.
/// If you want an update, you have to recreate the object. /// If you want an update, you have to recreate the object.