Tell the user how to revert dev setup intellij

This commit is contained in:
Serial 2022-07-28 03:40:21 -04:00
parent cdd4dfc6d6
commit 1ed7bff32c

View File

@ -13,7 +13,7 @@ pub enum CliError {
IoError(io::Error), IoError(io::Error),
RustfmtNotInstalled, RustfmtNotInstalled,
WalkDirError(walkdir::Error), WalkDirError(walkdir::Error),
RaSetupActive, IntellijSetupActive,
} }
impl From<io::Error> for CliError { 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") .expect("Failed to read clippy Cargo.toml")
.contains(&"[target.'cfg(NOT_A_PLATFORM)'.dependencies]") .contains(&"[target.'cfg(NOT_A_PLATFORM)'.dependencies]")
{ {
return Err(CliError::RaSetupActive); return Err(CliError::IntellijSetupActive);
} }
rustfmt_test(context)?; rustfmt_test(context)?;
@ -93,11 +93,11 @@ fn output_err(err: CliError) {
CliError::WalkDirError(err) => { CliError::WalkDirError(err) => {
eprintln!("error: {}", err); eprintln!("error: {}", err);
}, },
CliError::RaSetupActive => { CliError::IntellijSetupActive => {
eprintln!( eprintln!(
"error: a local rustc repo is enabled as path dependency via `cargo dev setup intellij`. "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! 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`."
); );
}, },
} }