Rollup merge of #70106 - ehuss:fix-tidy-fmt-twice, r=Mark-Simulacrum

Tidy: fix running rustfmt twice

`./x.py test tidy` runs rustfmt twice. This is because `Build::build` runs `execute_cli` twice (once dry, once not). This can be quite slow (and prints a bunch of things twice).

I'm not sure if this is really the best place to check the dry_run status.
This commit is contained in:
Mazdak Farrokhzad 2020-03-18 18:03:49 +01:00 committed by GitHub
commit b6f61a1f51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,6 +37,9 @@ struct RustfmtConfig {
} }
pub fn format(build: &Build, check: bool) { pub fn format(build: &Build, check: bool) {
if build.config.dry_run {
return;
}
let mut builder = ignore::types::TypesBuilder::new(); let mut builder = ignore::types::TypesBuilder::new();
builder.add_defaults(); builder.add_defaults();
builder.select("rust"); builder.select("rust");