Skip to content

Commit

Permalink
fix: use default the way clippy recommends
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulf Lilleengen committed Sep 22, 2023
1 parent 607bdeb commit c8f3dbc
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions indexer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,17 @@ pub enum IndexerCommand {
Reindex,
}

#[derive(clap::ValueEnum, Clone, Debug, PartialEq)]
#[derive(clap::ValueEnum, Default, Clone, Debug, PartialEq)]
pub enum ReindexMode {
#[clap(name = "always")]
Always,
#[default]
#[clap(name = "on-failure")]
OnFailure,
#[clap(name = "never")]
Never,
}

impl Default for ReindexMode {
fn default() -> Self {
ReindexMode::OnFailure
}
}

impl fmt::Display for ReindexMode {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Expand Down

0 comments on commit c8f3dbc

Please sign in to comment.