From ee7170011c27ec5336677cd7f91aa5a3203b7fd9 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 13 Jan 2021 10:07:53 +0100 Subject: Fix clippy: this `else { if .. }` block can be collapsed Signed-off-by: Matthias Beyer --- src/commands/build.rs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src/commands') diff --git a/src/commands/build.rs b/src/commands/build.rs index c4d876f..9dbd8ab 100644 --- a/src/commands/build.rs +++ b/src/commands/build.rs @@ -200,18 +200,16 @@ pub async fn build(repo_root: &Path, // linting the package scripts if matches.is_present("no_lint") { warn!("No script linting will be performed!"); + } else if let Some(linter) = crate::ui::find_linter_command(repo_root, config)? { + let all_packages = tree.all_packages(); + let bar = progressbars.bar(); + bar.set_length(all_packages.len() as u64); + bar.set_message("Linting package scripts..."); + + let iter = all_packages.into_iter(); + let _ = crate::commands::util::lint_packages(iter, &linter, config, bar).await?; } else { - if let Some(linter) = crate::ui::find_linter_command(repo_root, config)? { - let all_packages = tree.all_packages(); - let bar = progressbars.bar(); - bar.set_length(all_packages.len() as u64); - bar.set_message("Linting package scripts..."); - - let iter = all_packages.into_iter(); - let _ = crate::commands::util::lint_packages(iter, &linter, config, bar).await?; - } else { - warn!("No linter set in configuration, no script linting will be performed!"); - } + warn!("No linter set in configuration, no script linting will be performed!"); } // linting tree.all_packages() -- cgit v1.2.3