Skip to content

Commit

Permalink
Derive a Default impl
Browse files Browse the repository at this point in the history
  • Loading branch information
teor2345 committed Jan 16, 2023
1 parent f8f75f5 commit 28f48b8
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ impl From<GetBlockTemplate> for Response {
}

/// The source of the time in the block proposal header.
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
#[derive(Copy, Clone, Debug, Default, Eq, PartialEq)]
pub enum TimeSource {
/// The `curtime` field in the template.
/// This is the default time source.
#[default]
CurTime,

/// The `mintime` field in the template.
Expand Down Expand Up @@ -119,12 +120,6 @@ impl TimeSource {
}
}

impl Default for TimeSource {
fn default() -> Self {
TimeSource::CurTime
}
}

impl FromStr for TimeSource {
type Err = ParseIntError;

Expand Down

0 comments on commit 28f48b8

Please sign in to comment.