Skip to content

Commit

Permalink
fix: don't serialize empty backends
Browse files Browse the repository at this point in the history
  • Loading branch information
ripytide committed Oct 29, 2024
1 parent 5c000b2 commit 03200bb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/backends/all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ macro_rules! to_package_ids {

macro_rules! any {
($($backend:ident),*) => {
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Serialize, derive_more::FromStr, derive_more::Display)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, derive_more::FromStr, derive_more::Display)]
pub enum AnyBackend {
$($backend,)*
}
Expand All @@ -51,7 +51,7 @@ apply_public_backends!(any);

macro_rules! raw_package_ids {
($($backend:ident),*) => {
#[derive(Debug, Clone, Default, Serialize)]
#[derive(Debug, Clone, Default)]
#[allow(non_snake_case)]
pub struct RawPackageIds {
$(
Expand All @@ -75,6 +75,7 @@ macro_rules! package_ids {
#[allow(non_snake_case)]
pub struct PackageIds {
$(
#[serde(skip_serializing_if = "BTreeSet::is_empty")]
pub $backend: BTreeSet<String>,
)*
}
Expand Down

0 comments on commit 03200bb

Please sign in to comment.