diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2021-01-13 10:07:53 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2021-01-15 23:21:39 +0100 |
commit | ee7170011c27ec5336677cd7f91aa5a3203b7fd9 (patch) | |
tree | 80e0f0d37d81be0672155c8d7d2298ef17a7ac05 /src/commands/build.rs | |
parent | 0abc08977e369e8b66c46476ea7b8b300ec7759a (diff) |
Fix clippy: this `else { if .. }` block can be collapsed
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/commands/build.rs')
-rw-r--r-- | src/commands/build.rs | 20 |
1 files changed, 9 insertions, 11 deletions
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() |