diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2021-01-13 10:08:18 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2021-01-15 23:21:39 +0100 |
commit | 9a84de9cc099fc84db2fdb2d05381331166ca707 (patch) | |
tree | bf50f7ef1d20db84a0bb0b0eaab2f1c2b336f443 /src/commands/build.rs | |
parent | ee7170011c27ec5336677cd7f91aa5a3203b7fd9 (diff) |
Fix clippy: this `if` statement 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 | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/commands/build.rs b/src/commands/build.rs index 9dbd8ab..e7c20c7 100644 --- a/src/commands/build.rs +++ b/src/commands/build.rs @@ -78,13 +78,11 @@ pub async fn build(repo_root: &Path, }); let image_name = matches.value_of("image").map(String::from).map(ImageName::from).unwrap(); // safe by clap - if config.docker().verify_images_present() { - if !config.docker().images().iter().any(|img| image_name == *img) { - return Err(anyhow!("Requested build image {} is not in the configured images")) - .with_context(|| anyhow!("Available images: {:?}", config.docker().images())) - .with_context(|| anyhow!("Image present verification failed")) - .map_err(Error::from) - } + if config.docker().verify_images_present() && !config.docker().images().iter().any(|img| image_name == *img) { + return Err(anyhow!("Requested build image {} is not in the configured images")) + .with_context(|| anyhow!("Available images: {:?}", config.docker().images())) + .with_context(|| anyhow!("Image present verification failed")) + .map_err(Error::from) } debug!("Getting repository HEAD"); |