Revert "fix cargo clippy when using with --manifest-path
"
This reverts commit b31bebeea4b7ae1a1312049745649d8d2c89c0f4.
This commit is contained in:
parent
6ee6fe5776
commit
5b1d849c7e
@ -65,13 +65,8 @@ impl From<json::DecoderError> for Error {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn metadata(manifest_path: Option<String>) -> Result<Metadata, Error> {
|
||||
let mut cmd = Command::new("cargo");
|
||||
cmd.arg("metadata").arg("--no-deps");
|
||||
if let Some(ref mani) = manifest_path {
|
||||
cmd.arg(mani);
|
||||
}
|
||||
let output = cmd.output()?;
|
||||
pub fn metadata() -> Result<Metadata, Error> {
|
||||
let output = Command::new("cargo").args(&["metadata", "--no-deps"]).output()?;
|
||||
let stdout = from_utf8(&output.stdout)?;
|
||||
Ok(json::decode(stdout)?)
|
||||
}
|
||||
|
@ -129,8 +129,7 @@ pub fn main() {
|
||||
};
|
||||
|
||||
if let Some("clippy") = std::env::args().nth(1).as_ref().map(AsRef::as_ref) {
|
||||
let manifest_path = std::env::args().skip(2).find(|val| val.starts_with("--manifest-path="));
|
||||
let mut metadata = cargo::metadata(manifest_path).expect("could not obtain cargo metadata");
|
||||
let mut metadata = cargo::metadata().expect("could not obtain cargo metadata");
|
||||
assert_eq!(metadata.version, 1);
|
||||
for target in metadata.packages.remove(0).targets {
|
||||
let args = std::env::args().skip(2);
|
||||
|
Loading…
x
Reference in New Issue
Block a user