We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8a04ec6 commit 3759a66Copy full SHA for 3759a66
src/cargo-fmt/main.rs
@@ -127,7 +127,14 @@ fn get_version() -> Result<i32, io::Error> {
127
let mut command = Command::new("rustfmt")
128
.stdout(std::process::Stdio::inherit())
129
.args(&[String::from("--version")])
130
- .spawn()?;
+ .spawn()
131
+ .map_err(|e| match e.kind() {
132
+ io::ErrorKind::NotFound => io::Error::new(
133
+ io::ErrorKind::Other,
134
+ "Could not run rustfmt, please make sure it is in your PATH.",
135
+ ),
136
+ _ => e,
137
+ })?;
138
status.push(command.wait()?);
139
140
Ok(status
0 commit comments