Skip to content

Commit 7afef7f

Browse files
committed
fix(clippy): use derive for Default impl on OutputFormat
Rust 1.91 introduced a new lint 'derivable_impls' that flags manual Default implementations that can be derived. Changed OutputFormat to use #[derive(Default)] with #[default] attribute on the Json variant. Fixes CI clippy failure on Rust 1.91.0.
1 parent 2f71ab4 commit 7afef7f

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

crates/redisctl/src/output.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,14 @@ use jmespath::compile;
66
use serde::Serialize;
77
use serde_json::Value;
88

9-
#[derive(Debug, Clone, Copy, clap::ValueEnum)]
9+
#[derive(Debug, Clone, Copy, clap::ValueEnum, Default)]
1010
pub enum OutputFormat {
11+
#[default]
1112
Json,
1213
Yaml,
1314
Table,
1415
}
1516

16-
impl Default for OutputFormat {
17-
fn default() -> Self {
18-
Self::Json
19-
}
20-
}
21-
2217
impl OutputFormat {
2318
pub fn is_json(&self) -> bool {
2419
matches!(self, Self::Json)

0 commit comments

Comments
 (0)