diff options
| author | liv <liv@fastmail.com> | 2019-01-09 20:33:58 +0100 |
|---|---|---|
| committer | liv <liv@fastmail.com> | 2019-01-09 20:33:58 +0100 |
| commit | e03a98cbf6491dcf36e8a96fda20764bc1e1748e (patch) | |
| tree | 766db1a93071dd510219dc63872909481066c997 /src/run.rs | |
| parent | a388bb3798e2595c47924c6e4128f10e00cfc705 (diff) | |
rustfmt
Diffstat (limited to 'src/run.rs')
| -rw-r--r-- | src/run.rs | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -1,7 +1,7 @@ +use crate::util::clean; use console::{style, Emoji}; use indicatif::ProgressBar; use std::process::Command; -use crate::util::clean; pub fn run(matches: clap::ArgMatches) { if let Some(filename) = matches.value_of("file") { @@ -16,19 +16,17 @@ pub fn run(matches: clap::ArgMatches) { if compilecmd.status.success() { let runcmd = Command::new("./temp").output().expect("fail"); bar.finish_and_clear(); - + if runcmd.status.success() { println!("{}", String::from_utf8_lossy(&runcmd.stdout)); - let formatstr = - format!("{} Successfully ran {}", Emoji("✅", "✓"), filename); + let formatstr = format!("{} Successfully ran {}", Emoji("✅", "✓"), filename); println!("{}", style(formatstr).green()); clean(); } else { println!("{}", String::from_utf8_lossy(&runcmd.stdout)); println!("{}", String::from_utf8_lossy(&runcmd.stderr)); - - let formatstr = - format!("{} Ran {} with errors", Emoji("⚠️ ", "!"), filename); + + let formatstr = format!("{} Ran {} with errors", Emoji("⚠️ ", "!"), filename); println!("{}", style(formatstr).red()); clean(); } |
