Skip to content

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

Description

@oli-obk

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>,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions