mirror of
https://github.com/rust-lang/rustlings.git
synced 2025-12-28 06:49:19 +00:00
Don't run rustfmt during dev check if there are no solutions
This commit is contained in:
parent
57b3727b3e
commit
e8da6869f8
@ -354,13 +354,15 @@ fn check_solutions(
|
|||||||
}
|
}
|
||||||
stdout.write_all(b"\n")?;
|
stdout.write_all(b"\n")?;
|
||||||
|
|
||||||
|
let n_solutions = sol_paths.len();
|
||||||
let handle = thread::Builder::new()
|
let handle = thread::Builder::new()
|
||||||
.spawn(move || check_unexpected_files("solutions", &sol_paths))
|
.spawn(move || check_unexpected_files("solutions", &sol_paths))
|
||||||
.context(
|
.context(
|
||||||
"Failed to spawn a thread to check for unexpected files in the solutions directory",
|
"Failed to spawn a thread to check for unexpected files in the solutions directory",
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
if !fmt_cmd
|
if n_solutions > 0
|
||||||
|
&& !fmt_cmd
|
||||||
.status()
|
.status()
|
||||||
.context("Failed to run `rustfmt` on all solution files")?
|
.context("Failed to run `rustfmt` on all solution files")?
|
||||||
.success()
|
.success()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user