Skip to content

Commit 07c3acb

Browse files
authored
fix: address Rust 1.91.0 clippy lints (#678)
1 parent cd36aaf commit 07c3acb

File tree

2 files changed

+26
-14
lines changed

2 files changed

+26
-14
lines changed

ic-cdk/src/api/management_canister/bitcoin/types.rs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,18 @@ pub type Satoshi = u64;
66

77
/// Bitcoin Network.
88
#[derive(
9-
CandidType, Serialize, Deserialize, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy,
9+
CandidType,
10+
Serialize,
11+
Deserialize,
12+
Debug,
13+
PartialEq,
14+
Eq,
15+
PartialOrd,
16+
Ord,
17+
Hash,
18+
Clone,
19+
Copy,
20+
Default,
1021
)]
1122
pub enum BitcoinNetwork {
1223
/// Mainnet.
@@ -19,15 +30,10 @@ pub enum BitcoinNetwork {
1930
///
2031
/// This is only available when developing with local replica.
2132
#[serde(rename = "regtest")]
33+
#[default]
2234
Regtest,
2335
}
2436

25-
impl Default for BitcoinNetwork {
26-
fn default() -> Self {
27-
Self::Regtest
28-
}
29-
}
30-
3137
/// Bitcoin Address.
3238
pub type BitcoinAddress = String;
3339

ic-cdk/src/api/management_canister/ecdsa/types.rs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,22 @@ pub struct EcdsaKeyId {
6262

6363
/// ECDSA Curve.
6464
#[derive(
65-
CandidType, Serialize, Deserialize, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy,
65+
CandidType,
66+
Serialize,
67+
Deserialize,
68+
Debug,
69+
PartialEq,
70+
Eq,
71+
PartialOrd,
72+
Ord,
73+
Hash,
74+
Clone,
75+
Copy,
76+
Default,
6677
)]
6778
pub enum EcdsaCurve {
6879
/// secp256k1
6980
#[serde(rename = "secp256k1")]
81+
#[default]
7082
Secp256k1,
7183
}
72-
73-
impl Default for EcdsaCurve {
74-
fn default() -> Self {
75-
Self::Secp256k1
76-
}
77-
}

0 commit comments

Comments
 (0)