diff --git a/src/main.rs b/src/main.rs index c52490a..953abb6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -241,9 +241,7 @@ fn run(args: Args) -> Result<()> { match args.subcommand { Some(SubCommand::Completions(completions)) => args::gen_completions(&completions), _ => { - let mut theme = Theme::new(); - theme.columns = args.columns; - + let theme = Theme { columns: args.columns, ..Default::default() }; let delimiter = if args.base10 { NumberFormat::Base10 } else { diff --git a/src/theme.rs b/src/theme.rs index 46743f3..e395164 100644 --- a/src/theme.rs +++ b/src/theme.rs @@ -17,8 +17,8 @@ pub struct Theme { pub columns: Vec, } -impl Theme { - pub fn new() -> Self { +impl Default for Theme { + fn default() -> Self { Self { char_bar_filled: named_char::HEAVY_BOX, char_bar_empty: named_char::HEAVY_DOUBLE_DASH,