Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use an enum for Target::kind and Target::crate_types #239

Open
oli-obk opened this issue Jul 12, 2023 · 0 comments
Open

use an enum for Target::kind and Target::crate_types #239

oli-obk opened this issue Jul 12, 2023 · 0 comments

Comments

@oli-obk
Copy link
Owner

oli-obk commented Jul 12, 2023

We know all possible variants, and can still include an Unknown(String) fallback to be more forward compatible.

The fields I'm talking about are

cargo_metadata/src/lib.rs

Lines 440 to 446 in 56fcbaa

/// Kind of target ("bin", "example", "test", "bench", "lib", "custom-build")
pub kind: Vec<String>,
/// Almost the same as `kind`, except when an example is a library instead of an executable.
/// In that case `crate_types` contains things like `rlib` and `dylib` while `kind` is `example`
#[serde(default)]
#[cfg_attr(feature = "builder", builder(default))]
pub crate_types: Vec<String>,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant