Skip to content

Commit 5b1d849

Browse files
committed
Revert "fix cargo clippy when using with --manifest-path"
This reverts commit b31bebe.
1 parent 6ee6fe5 commit 5b1d849

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

clippy_lints/src/utils/cargo.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,8 @@ impl From<json::DecoderError> for Error {
6565
}
6666
}
6767

68-
pub fn metadata(manifest_path: Option<String>) -> Result<Metadata, Error> {
69-
let mut cmd = Command::new("cargo");
70-
cmd.arg("metadata").arg("--no-deps");
71-
if let Some(ref mani) = manifest_path {
72-
cmd.arg(mani);
73-
}
74-
let output = cmd.output()?;
68+
pub fn metadata() -> Result<Metadata, Error> {
69+
let output = Command::new("cargo").args(&["metadata", "--no-deps"]).output()?;
7570
let stdout = from_utf8(&output.stdout)?;
7671
Ok(json::decode(stdout)?)
7772
}

src/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ pub fn main() {
129129
};
130130

131131
if let Some("clippy") = std::env::args().nth(1).as_ref().map(AsRef::as_ref) {
132-
let manifest_path = std::env::args().skip(2).find(|val| val.starts_with("--manifest-path="));
133-
let mut metadata = cargo::metadata(manifest_path).expect("could not obtain cargo metadata");
132+
let mut metadata = cargo::metadata().expect("could not obtain cargo metadata");
134133
assert_eq!(metadata.version, 1);
135134
for target in metadata.packages.remove(0).targets {
136135
let args = std::env::args().skip(2);

0 commit comments

Comments
 (0)