Skip to content

Commit efa632e

Browse files
committed
dropped default_instant helper
1 parent 805ba4c commit efa632e

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

dash-spv/src/network/reputation.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,6 @@ const MAX_BAN_COUNT: u32 = 1000;
8787

8888
const MAX_ACTION_COUNT: u64 = 1_000_000;
8989

90-
fn default_instant() -> Instant {
91-
Instant::now()
92-
}
93-
9490
fn clamp_peer_score<'de, D>(deserializer: D) -> Result<i32, D::Error>
9591
where
9692
D: Deserializer<'de>,
@@ -149,7 +145,7 @@ pub struct PeerReputation {
149145
pub banned_until: Option<Instant>,
150146

151147
/// Last time the reputation was updated
152-
#[serde(skip, default = "default_instant")]
148+
#[serde(skip, default = "Instant::now")]
153149
pub last_update: Instant,
154150

155151
/// Total number of positive actions
@@ -176,7 +172,7 @@ impl Default for PeerReputation {
176172
score: 0,
177173
ban_count: 0,
178174
banned_until: None,
179-
last_update: default_instant(),
175+
last_update: Instant::now(),
180176
positive_actions: 0,
181177
negative_actions: 0,
182178
connection_attempts: 0,

0 commit comments

Comments
 (0)