mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 15:11:30 +00:00
no indexing
This commit is contained in:
parent
7bb8ba4631
commit
078cc68c52
1 changed files with 8 additions and 5 deletions
|
@ -126,12 +126,15 @@ pub fn main() {
|
|||
assert_eq!(metadata.version, 1);
|
||||
for target in metadata.packages.remove(0).targets {
|
||||
let args = std::env::args().skip(2);
|
||||
assert!(!target.kind.is_empty());
|
||||
if target.kind.len() > 1 || target.kind[0].ends_with("lib") {
|
||||
if let Some(first) = target.kind.get(0) {
|
||||
if target.kind.len() > 1 || first.ends_with("lib") {
|
||||
process(std::iter::once("--lib".to_owned()).chain(args), &dep_path, &sys_root);
|
||||
} else if target.kind[0] == "bin" {
|
||||
} else if first == "bin" {
|
||||
process(vec!["--bin".to_owned(), target.name].into_iter().chain(args), &dep_path, &sys_root);
|
||||
}
|
||||
} else {
|
||||
panic!("badly formatted cargo metadata: target::kind is an empty array");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
let args: Vec<String> = if env::args().any(|s| s == "--sysroot") {
|
||||
|
|
Loading…
Reference in a new issue