don't serialize empty vecs
All checks were successful
Test Rust project / test (ubuntu-latest, stable) (push) Successful in 2m47s

This commit is contained in:
oliver 2024-07-29 12:27:22 -06:00
parent 620b855f1d
commit c5cb4eb524

View File

@ -10,14 +10,18 @@ use tracing::{debug, error, info, trace};
#[derive(Serialize)] #[derive(Serialize)]
struct Server { struct Server {
channels: Vec<Channel>, channels: Vec<Channel>,
#[serde(skip_serializing_if = "Vec::is_empty")]
orphanage: Vec<GuildChannel>, orphanage: Vec<GuildChannel>,
#[serde(skip_serializing)]
needs_clean: bool, needs_clean: bool,
} }
#[derive(Serialize)] #[derive(Serialize)]
struct Channel { struct Channel {
this: GuildChannel, this: GuildChannel,
#[serde(skip_serializing_if = "Vec::is_empty")]
children: Vec<Channel>, children: Vec<Channel>,
#[serde(skip_serializing_if = "Vec::is_empty")]
messages: Vec<Message>, messages: Vec<Message>,
} }