Improve error message when failing cargo metadata (#3024)

This commit is contained in:
Nathan Sutton 2018-09-18 06:20:07 -05:00 committed by Seiichi Uchida
parent 68ede7bf45
commit d165533813

View File

@ -373,9 +373,6 @@ fn run_rustfmt(
fn get_cargo_metadata(manifest_path: Option<&Path>) -> Result<cargo_metadata::Metadata, io::Error> { fn get_cargo_metadata(manifest_path: Option<&Path>) -> Result<cargo_metadata::Metadata, io::Error> {
match cargo_metadata::metadata(manifest_path) { match cargo_metadata::metadata(manifest_path) {
Ok(metadata) => Ok(metadata), Ok(metadata) => Ok(metadata),
Err(..) => Err(io::Error::new( Err(error) => Err(io::Error::new(io::ErrorKind::Other, error.to_string())),
io::ErrorKind::Other,
"`cargo manifest` failed.",
)),
} }
} }