From 69ef7154ddcb4c57a882044e6351395fe56ef075 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Sat, 3 Apr 2021 18:35:08 -0600 Subject: don't try to build anything if we're printing everything --- src/main.rs | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index 64dcd2a..ceeb0cf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -71,21 +71,20 @@ fn main() -> Result<()> { if args.print_everything { println!("{}", &makefile); - } - - let targets = if args.targets().count() == 0 { - let first_target = makefile.first_non_special_target.clone(); - match first_target { - Some(x) => vec![x], - None => bail!("no targets given on command line or found in makefile."), - } } else { - args.targets().cloned().collect() - }; + let targets = if args.targets().count() == 0 { + let first_target = makefile.first_non_special_target.clone(); + match first_target { + Some(x) => vec![x], + None => bail!("no targets given on command line or found in makefile."), + } + } else { + args.targets().cloned().collect() + }; - for target in targets { - makefile.update_target(&target)?; + for target in targets { + makefile.update_target(&target)?; + } } - Ok(()) } -- cgit v1.2.3