From 6ff3587dbcde3adce22620f4f5657692b83d3a02 Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Tue, 10 Dec 2024 00:33:26 +0000 Subject: [PATCH] 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 --- libcnb-package/src/cargo.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcnb-package/src/cargo.rs b/libcnb-package/src/cargo.rs index 9b3e4876..140d7c33 100644 --- a/libcnb-package/src/cargo.rs +++ b/libcnb-package/src/cargo.rs @@ -48,5 +48,5 @@ fn cargo_binary_target_names_from_root_package( } fn is_binary_target(target: &cargo_metadata::Target) -> bool { - target.kind.contains(&String::from("bin")) + target.is_bin() }