Skip to content

Commit e5d5cad

Browse files
committed
chore: solve clippy lints
1 parent 618b84e commit e5d5cad

File tree

4 files changed

+7
-21
lines changed

4 files changed

+7
-21
lines changed

src/importers/aegis.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pub struct AegisJson {
1010
}
1111

1212
#[derive(Deserialize)]
13+
#[allow(dead_code)]
1314
struct AegisHeader {
1415
//slots: Option<String>,
1516
//params: Option<String>,

src/interface/enums.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,9 @@ pub enum PopupAction {
1313
SaveBeforeQuit,
1414
}
1515

16-
#[derive(Eq, PartialEq, Debug)]
16+
#[derive(Eq, PartialEq, Debug, Default)]
1717
pub enum Page {
18+
#[default]
1819
Main,
1920
Qrcode,
2021
}
21-
22-
impl Default for Page {
23-
fn default() -> Self {
24-
Self::Main
25-
}
26-
}

src/otp/otp_algorithm.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,16 @@ use clap::ValueEnum;
44
use serde::{Deserialize, Serialize};
55
use zeroize::Zeroize;
66

7-
#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone, Copy, ValueEnum, Hash)]
7+
#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone, Copy, ValueEnum, Hash, Default)]
88
#[serde(rename_all = "UPPERCASE")]
99
pub enum OTPAlgorithm {
10+
#[default]
1011
Sha1,
1112
Sha256,
1213
Sha512,
1314
Md5,
1415
}
1516

16-
impl Default for OTPAlgorithm {
17-
fn default() -> Self {
18-
Self::Sha1
19-
}
20-
}
21-
2217
impl fmt::Display for OTPAlgorithm {
2318
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2419
let to_string = match self {

src/otp/otp_type.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ use clap::ValueEnum;
44
use serde::{Deserialize, Serialize};
55
use zeroize::Zeroize;
66

7-
#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone, Copy, ValueEnum, Hash)]
7+
#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone, Copy, ValueEnum, Hash, Default)]
88
#[serde(rename_all = "UPPERCASE")]
99
pub enum OTPType {
1010
#[serde(alias = "totp")]
1111
#[serde(alias = "TOTP")]
12+
#[default]
1213
Totp,
1314
#[serde(alias = "hotp")]
1415
#[serde(alias = "HOTP")]
@@ -24,12 +25,6 @@ pub enum OTPType {
2425
Motp,
2526
}
2627

27-
impl Default for OTPType {
28-
fn default() -> Self {
29-
Self::Totp
30-
}
31-
}
32-
3328
impl fmt::Display for OTPType {
3429
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3530
let to_string = match self {

0 commit comments

Comments
 (0)