Skip to content

Commit 6923707

Browse files
committed
chore: Apply Clippy lint derivable_impls
1 parent 1f97bcf commit 6923707

File tree

2 files changed

+7
-31
lines changed

2 files changed

+7
-31
lines changed

stackslib/src/config/mod.rs

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,40 +1664,25 @@ pub struct NodeConfig {
16641664
pub stacker_dbs: Vec<QualifiedContractIdentifier>,
16651665
}
16661666

1667-
#[derive(Clone, Debug)]
1667+
#[derive(Clone, Debug, Default)]
16681668
pub enum CostEstimatorName {
1669+
#[default]
16691670
NaivePessimistic,
16701671
}
16711672

1672-
#[derive(Clone, Debug)]
1673+
#[derive(Clone, Debug, Default)]
16731674
pub enum FeeEstimatorName {
1675+
#[default]
16741676
ScalarFeeRate,
16751677
FuzzedWeightedMedianFeeRate,
16761678
}
16771679

1678-
#[derive(Clone, Debug)]
1680+
#[derive(Clone, Debug, Default)]
16791681
pub enum CostMetricName {
1682+
#[default]
16801683
ProportionDotProduct,
16811684
}
16821685

1683-
impl Default for CostEstimatorName {
1684-
fn default() -> Self {
1685-
CostEstimatorName::NaivePessimistic
1686-
}
1687-
}
1688-
1689-
impl Default for FeeEstimatorName {
1690-
fn default() -> Self {
1691-
FeeEstimatorName::ScalarFeeRate
1692-
}
1693-
}
1694-
1695-
impl Default for CostMetricName {
1696-
fn default() -> Self {
1697-
CostMetricName::ProportionDotProduct
1698-
}
1699-
}
1700-
17011686
impl CostEstimatorName {
17021687
fn panic_parse(s: String) -> CostEstimatorName {
17031688
if &s.to_lowercase() == "naive_pessimistic" {

stackslib/src/net/chat.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,12 @@ use crate::net::{
5252
use crate::util_lib::db::{DBConn, Error as db_error};
5353

5454
// did we or did we not successfully send a message?
55-
#[derive(Debug, Clone)]
55+
#[derive(Debug, Clone, Default)]
5656
pub struct NeighborHealthPoint {
5757
pub success: bool,
5858
pub time: u64,
5959
}
6060

61-
impl Default for NeighborHealthPoint {
62-
fn default() -> NeighborHealthPoint {
63-
NeighborHealthPoint {
64-
success: false,
65-
time: 0,
66-
}
67-
}
68-
}
69-
7061
pub const NUM_HEALTH_POINTS: usize = 32;
7162
pub const HEALTH_POINT_LIFETIME: u64 = 12 * 3600; // 12 hours
7263

0 commit comments

Comments
 (0)