Skip to content

Commit 37a2049

Browse files
committed
check first
1 parent 35e6938 commit 37a2049

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,11 @@ fn is_rust_file<P: AsRef<Path>>(path: P) -> bool {
251251
fn main() -> ExitCode {
252252
let opts = Opts::parse();
253253

254+
let run_dirs = get_run_dirs(&opts.files);
255+
if run_dirs.is_empty() {
256+
return ExitCode::SUCCESS;
257+
}
258+
254259
if let Err(e) = check_toolchain(&opts.cargo_opts) {
255260
eprintln!("{e}");
256261
return ExitCode::FAILURE;
@@ -260,7 +265,6 @@ fn main() -> ExitCode {
260265
return ExitCode::FAILURE;
261266
}
262267

263-
let run_dirs = get_run_dirs(&opts.files);
264268
let err_count = run_dirs
265269
.into_iter()
266270
.map(|dir| opts.cmd.run(dir))

0 commit comments

Comments
 (0)