diff --git a/src/dependencies.rs b/src/dependencies.rs index 6f6d983b..6b3e3035 100644 --- a/src/dependencies.rs +++ b/src/dependencies.rs @@ -90,17 +90,19 @@ fn build_dependencies_inner(config: &Config, info: &DependencyBuilder) -> Result let mut import_paths: HashSet = HashSet::new(); let mut import_libs: HashSet = HashSet::new(); let mut artifacts = HashMap::new(); - 'artifact: for line in artifact_output.lines() { + for line in artifact_output.lines() { let Ok(message) = serde_json::from_str::(line) else { continue; }; match message { cargo_metadata::Message::CompilerArtifact(artifact) => { - for ctype in &artifact.target.crate_types { - match ctype.as_str() { - "proc-macro" | "lib" => {} - _ => continue 'artifact, - } + if artifact + .target + .crate_types + .iter() + .all(|ctype| !matches!(ctype.as_str(), "proc-macro" | "lib")) + { + continue; } for filename in &artifact.filenames { import_paths.insert(filename.parent().unwrap().into()); diff --git a/tests/integrations/basic/Cargo.toml b/tests/integrations/basic/Cargo.toml index 6d404d17..72ce8995 100644 --- a/tests/integrations/basic/Cargo.toml +++ b/tests/integrations/basic/Cargo.toml @@ -19,3 +19,7 @@ harness = false [[test]] name = "run_file" harness = true + +# Regression check for #225 +[lib] +crate-type = ["staticlib", "lib"]