Skip to content

Commit

Permalink
Upgrade cargo_metadata to 0.19
Browse files Browse the repository at this point in the history
  • Loading branch information
paolobarbolini committed Dec 4, 2024
1 parent 79b3879 commit 75171d8
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 25 deletions.
44 changes: 22 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ eula = false
[dependencies]
anyhow = "1.0.86"
camino = "1.1.6"
cargo_metadata = "0.18"
cargo_metadata = "0.19"
clap = { version = "4.4.1", features = [
"deprecated",
"derive",
Expand Down
14 changes: 12 additions & 2 deletions src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use std::process::Command;

use anyhow::{anyhow, bail, ensure, Context};
use camino::{Utf8Path, Utf8PathBuf};
use cargo_metadata::Metadata;
use cargo_metadata::{Metadata, TargetKind};
use itertools::Itertools;
use serde_json::Value;
use tracing::{debug, debug_span, error, warn};
Expand Down Expand Up @@ -306,7 +306,17 @@ fn package_top_sources(

fn should_mutate_target(target: &cargo_metadata::Target) -> bool {
for kind in &target.kind {
if kind == "bin" || kind == "proc-macro" || kind.ends_with("lib") {
// bin / proc-macro / *lib
if matches!(
kind,
TargetKind::Bin
| TargetKind::ProcMacro
| TargetKind::CDyLib
| TargetKind::DyLib
| TargetKind::Lib
| TargetKind::RLib
| TargetKind::StaticLib
) {
return true;
}
}
Expand Down

0 comments on commit 75171d8

Please sign in to comment.