mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-31 17:12:53 +00:00
Merge pull request #1084 from johannhof/rustfmt-not-found
Show more helpful error if rustfmt is not in PATH.
This commit is contained in:
commit
ffa5a22d1c
@ -203,6 +203,16 @@ fn format_files(files: &Vec<PathBuf>,
|
||||
.stdout(stdout)
|
||||
.args(files)
|
||||
.args(fmt_args)
|
||||
.spawn());
|
||||
.spawn()
|
||||
.map_err(|e| {
|
||||
match e.kind() {
|
||||
std::io::ErrorKind::NotFound => {
|
||||
std::io::Error::new(std::io::ErrorKind::Other,
|
||||
"Could not run rustfmt, please make sure it is in your \
|
||||
PATH.")
|
||||
}
|
||||
_ => e,
|
||||
}
|
||||
}));
|
||||
command.wait()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user