From 425f2cf9887e10e0e1d1fec58c965e5c5cfb41fc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 00:39:38 +0000 Subject: [PATCH] Update cargo_metadata requirement from 0.18.1 to 0.19.1 (#889) * Update cargo_metadata requirement from 0.18.1 to 0.19.1 Updates the requirements on [cargo_metadata](https://github.com/oli-obk/cargo_metadata) to permit the latest version. - [Release notes](https://github.com/oli-obk/cargo_metadata/releases) - [Changelog](https://github.com/oli-obk/cargo_metadata/blob/main/CHANGELOG.md) - [Commits](https://github.com/oli-obk/cargo_metadata/compare/0.18.1...0.19.1) --- updated-dependencies: - dependency-name: cargo_metadata dependency-type: direct:production ... Signed-off-by: dependabot[bot] * Update for breaking API changes Fixes: ``` error[E0308]: mismatched types --> libcnb-package/src/cargo.rs:51:26 | 51 | target.kind.contains(&String::from("bin")) | -------- ^^^^^^^^^^^^^^^^^^^^ expected `&TargetKind`, found `&String` | | | arguments to this method are incorrect | = note: expected reference `&cargo_metadata::TargetKind` found reference `&std::string::String` ``` Due to: https://github.com/oli-obk/cargo_metadata/pull/258 However, we can use this simpler API instead: https://docs.rs/cargo_metadata/latest/cargo_metadata/struct.Target.html#method.is_bin * Inline `is_binary_target` Since it's only used once and its implementation is now trivial. --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com> --- libcnb-package/Cargo.toml | 2 +- libcnb-package/src/cargo.rs | 6 +----- libcnb-proc-macros/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/libcnb-package/Cargo.toml b/libcnb-package/Cargo.toml index fa67460b..f4e2ecd2 100644 --- a/libcnb-package/Cargo.toml +++ b/libcnb-package/Cargo.toml @@ -15,7 +15,7 @@ include = ["src/**/*", "LICENSE", "README.md"] workspace = true [dependencies] -cargo_metadata = "0.18.1" +cargo_metadata = "0.19.1" ignore = "0.4.23" indoc = "2.0.5" libcnb-common.workspace = true diff --git a/libcnb-package/src/cargo.rs b/libcnb-package/src/cargo.rs index 9b3e4876..65a83398 100644 --- a/libcnb-package/src/cargo.rs +++ b/libcnb-package/src/cargo.rs @@ -43,10 +43,6 @@ fn cargo_binary_target_names_from_root_package( root_package .targets .iter() - .filter_map(|target| is_binary_target(target).then_some(target.name.clone())) + .filter_map(|target| target.is_bin().then_some(target.name.clone())) .collect() } - -fn is_binary_target(target: &cargo_metadata::Target) -> bool { - target.kind.contains(&String::from("bin")) -} diff --git a/libcnb-proc-macros/Cargo.toml b/libcnb-proc-macros/Cargo.toml index 3dbe78fe..9ac01cc0 100644 --- a/libcnb-proc-macros/Cargo.toml +++ b/libcnb-proc-macros/Cargo.toml @@ -17,7 +17,7 @@ proc-macro = true workspace = true [dependencies] -cargo_metadata = "0.18.1" +cargo_metadata = "0.19.1" fancy-regex = { version = "0.14.0", default-features = false, features = ["std"] } quote = "1.0.37" syn = { version = "2.0.87", features = ["full"] }