Skip to content

Commit

Permalink
Update for breaking API changes
Browse files Browse the repository at this point in the history
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:
oli-obk/cargo_metadata#258

However, we can use this simpler API instead:
https://docs.rs/cargo_metadata/latest/cargo_metadata/struct.Target.html#method.is_bin
  • Loading branch information
edmorley committed Dec 10, 2024
1 parent 84eef82 commit 6ff3587
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libcnb-package/src/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

0 comments on commit 6ff3587

Please sign in to comment.