summaryrefslogtreecommitdiffstats
path: root/src/commands/build.rs
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-01-13 10:07:53 +0100
committerMatthias Beyer <mail@beyermatthias.de>2021-01-15 23:21:39 +0100
commitee7170011c27ec5336677cd7f91aa5a3203b7fd9 (patch)
tree80e0f0d37d81be0672155c8d7d2298ef17a7ac05 /src/commands/build.rs
parent0abc08977e369e8b66c46476ea7b8b300ec7759a (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.rs20
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()