Skip to content

Commit

Permalink
Merge pull request #266 from os-checker/workspace_default_members-ser…
Browse files Browse the repository at this point in the history
…de-default

fix(Metadata): add `#[serde(default)]` on workspace_default_members field
  • Loading branch information
oli-obk authored Dec 3, 2024
2 parents 8f4c3a8 + 45ceca0 commit 9d84a01
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ pub struct Metadata {
/// The list of default workspace members
///
/// This not available if running with a version of Cargo older than 1.71.
#[serde(skip_serializing_if = "workspace_default_members_is_missing")]
#[serde(default, skip_serializing_if = "workspace_default_members_is_missing")]
pub workspace_default_members: WorkspaceDefaultMembers,
/// Dependencies graph
pub resolve: Option<Resolve>,
Expand Down Expand Up @@ -224,7 +224,7 @@ impl<'a> std::ops::Index<&'a PackageId> for Metadata {
}
}

#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq, Hash)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq, Hash, Default)]
#[serde(transparent)]
/// A list of default workspace members.
///
Expand Down Expand Up @@ -728,6 +728,7 @@ impl fmt::Display for TargetKind {

/// Similar to `kind`, but only reports the
/// [Cargo crate types](https://doc.rust-lang.org/cargo/reference/cargo-targets.html#the-crate-type-field):
///
/// `bin`, `lib`, `rlib`, `dylib`, `cdylib`, `staticlib`, `proc-macro`.
/// Everything that's not a proc macro or a library of some kind is reported as "bin".
///
Expand Down

0 comments on commit 9d84a01

Please sign in to comment.