From b375a1533fc73f65ac08c8b32be65fd552e3cc6a Mon Sep 17 00:00:00 2001 From: Ana Hobden Date: Wed, 8 Nov 2023 08:34:34 -0800 Subject: [PATCH] Feed Clippy --- src/cli/cmd/list.rs | 12 +++++------- src/cli/cmd/mod.rs | 3 ++- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/cli/cmd/list.rs b/src/cli/cmd/list.rs index 612ecb9e..ddd3a1d3 100644 --- a/src/cli/cmd/list.rs +++ b/src/cli/cmd/list.rs @@ -213,14 +213,12 @@ impl CommandExecute for ListSubcommand { eprintln!("No results"); } else if self.json { print_json(&releases)?; + } else if std::io::stdout().is_terminal() { + let mut table = Table::new(releases); + table.with(DEFAULT_STYLE.clone()); + println!("{table}"); } else { - if std::io::stdout().is_terminal() { - let mut table = Table::new(releases); - table.with(DEFAULT_STYLE.clone()); - println!("{table}"); - } else { - csv::Writer::from_writer(std::io::stdout()).serialize(releases)?; - } + csv::Writer::from_writer(std::io::stdout()).serialize(releases)?; } } Err(e) => return Err(e.into()), diff --git a/src/cli/cmd/mod.rs b/src/cli/cmd/mod.rs index 1ad35848..6be19dc9 100644 --- a/src/cli/cmd/mod.rs +++ b/src/cli/cmd/mod.rs @@ -21,7 +21,8 @@ use self::{ search::SearchResult, }; -const DEFAULT_STYLE: Lazy< +#[allow(clippy::type_complexity)] +static DEFAULT_STYLE: Lazy< Style< On, On,