Auto merge of #9253 - Serial-ATA:fix-fmt-err, r=flip1995

Tell the user how to revert `dev setup intellij`

changelog: none
This commit is contained in:
bors 2022-07-28 07:54:15 +00:00
commit 70bca2988b

View File

@ -13,7 +13,7 @@ pub enum CliError {
IoError(io::Error),
RustfmtNotInstalled,
WalkDirError(walkdir::Error),
RaSetupActive,
IntellijSetupActive,
}
impl From<io::Error> for CliError {
@ -48,7 +48,7 @@ fn try_run(context: &FmtContext) -> Result<bool, CliError> {
.expect("Failed to read clippy Cargo.toml")
.contains(&"[target.'cfg(NOT_A_PLATFORM)'.dependencies]")
{
return Err(CliError::RaSetupActive);
return Err(CliError::IntellijSetupActive);
}
rustfmt_test(context)?;
@ -93,11 +93,11 @@ fn output_err(err: CliError) {
CliError::WalkDirError(err) => {
eprintln!("error: {}", err);
},
CliError::RaSetupActive => {
CliError::IntellijSetupActive => {
eprintln!(
"error: a local rustc repo is enabled as path dependency via `cargo dev setup intellij`.
Not formatting because that would format the local repo as well!
Please revert the changes to Cargo.tomls first."
Please revert the changes to Cargo.tomls with `cargo dev remove intellij`."
);
},
}