Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 28 additions & 7 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 @@ -16,7 +16,7 @@ version = "0.4.0"
rust-version = "1.78.0"

[dependencies]
cargo_metadata = "0.18.1"
cargo_metadata = "0.23"
clap = { version = "4.4.8", features = ["cargo", "wrap_help", "string"] }
regex = "1.5"
rustc-cfg = "0.5"
Expand Down
10 changes: 7 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use anyhow::{bail, Result};
use cargo_metadata::camino::Utf8Component;
use cargo_metadata::{Artifact, CargoOpt, Message, Metadata, MetadataCommand};
use cargo_metadata::{Artifact, CargoOpt, Message, Metadata, MetadataCommand, TargetKind};
use clap::{Arg, ArgAction, ArgMatches, Command as ClapCommand};
use rustc_cfg::Cfg;

Expand Down Expand Up @@ -134,10 +134,14 @@
.target
.kind
.iter()
.any(|s| s == "bin" || s == "example"),
.any(|s| s == &TargetKind::Bin || s == &TargetKind::Example),
// Since LibKind can be an arbitrary string `LibKind:Other(String)` we filter by what it can't be
BuildType::Lib => artifact.target.kind.iter().any(|s| {
s != "bin" && s != "example" && s != "test" && s != "custom-build" && s != "bench"
s != &TargetKind::Bin
&& s != &TargetKind::Example
&& s != &TargetKind::Test
&& s != &TargetKind::CustomBuild
&& s != &TargetKind::Bench
}),
}
}
Expand Down Expand Up @@ -449,7 +453,7 @@
for message in messages {
match message? {
Message::CompilerArtifact(artifact) => {
if metadata.workspace_members.contains(&artifact.package_id)

Check failure on line 456 in src/lib.rs

View workflow job for this annotation

GitHub Actions / ci (nightly, ubuntu-latest, true)

this `if` can be collapsed into the outer `match`
&& build_type.matches(&artifact)
{
if target_artifact.is_some() {
Expand All @@ -460,7 +464,7 @@
}
}
Message::CompilerMessage(msg) => {
if !quiet || verbose > 1 {

Check failure on line 467 in src/lib.rs

View workflow job for this annotation

GitHub Actions / ci (nightly, ubuntu-latest, true)

this `if` can be collapsed into the outer `match`
if let Some(rendered) = msg.message.rendered {
eprint!("{rendered}");
}
Expand Down
Loading