Skip to content

Commit 5995925

Browse files
committed
chore: fix Rust 1.91.0 lint for derivable Default
1 parent 08f8f48 commit 5995925

File tree

4 files changed

+8
-27
lines changed

4 files changed

+8
-27
lines changed

src/configure/auto_mozilla.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,16 @@ struct MozAutoconfigure {
2828
pub outgoing_servers: Vec<Server>,
2929
}
3030

31-
#[derive(Debug)]
31+
#[derive(Debug, Default)]
3232
enum MozConfigTag {
33+
#[default]
3334
Undefined,
3435
Hostname,
3536
Port,
3637
Sockettype,
3738
Username,
3839
}
3940

40-
impl Default for MozConfigTag {
41-
fn default() -> Self {
42-
Self::Undefined
43-
}
44-
}
45-
4641
impl FromStr for MozConfigTag {
4742
type Err = ();
4843

src/context.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ pub struct InnerContext {
308308
}
309309

310310
/// The state of ongoing process.
311-
#[derive(Debug)]
311+
#[derive(Debug, Default)]
312312
enum RunningState {
313313
/// Ongoing process is allocated.
314314
Running { cancel_sender: Sender<()> },
@@ -317,15 +317,10 @@ enum RunningState {
317317
ShallStop { request: tools::Time },
318318

319319
/// There is no ongoing process, a new one can be allocated.
320+
#[default]
320321
Stopped,
321322
}
322323

323-
impl Default for RunningState {
324-
fn default() -> Self {
325-
Self::Stopped
326-
}
327-
}
328-
329324
/// Return some info about deltachat-core
330325
///
331326
/// This contains information mostly about the library itself, the

src/ephemeral.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,10 @@ use crate::tools::{SystemTime, duration_to_str, time};
8888
use crate::{location, stats};
8989

9090
/// Ephemeral timer value.
91-
#[derive(Debug, PartialEq, Eq, Copy, Clone, Serialize, Deserialize)]
91+
#[derive(Debug, PartialEq, Eq, Copy, Clone, Serialize, Deserialize, Default)]
9292
pub enum Timer {
9393
/// Timer is disabled.
94+
#[default]
9495
Disabled,
9596

9697
/// Timer is enabled.
@@ -125,12 +126,6 @@ impl Timer {
125126
}
126127
}
127128

128-
impl Default for Timer {
129-
fn default() -> Self {
130-
Self::Disabled
131-
}
132-
}
133-
134129
impl fmt::Display for Timer {
135130
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
136131
write!(f, "{}", self.to_u32())

src/message.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -381,22 +381,18 @@ impl rusqlite::types::FromSql for MsgId {
381381
ToSql,
382382
Serialize,
383383
Deserialize,
384+
Default,
384385
)]
385386
#[repr(u8)]
386387
pub(crate) enum MessengerMessage {
388+
#[default]
387389
No = 0,
388390
Yes = 1,
389391

390392
/// No, but reply to messenger message.
391393
Reply = 2,
392394
}
393395

394-
impl Default for MessengerMessage {
395-
fn default() -> Self {
396-
Self::No
397-
}
398-
}
399-
400396
/// An object representing a single message in memory.
401397
/// The message object is not updated.
402398
/// If you want an update, you have to recreate the object.

0 commit comments

Comments
 (0)