generated from Oliver/discord-bot-template
don't serialize empty vecs
All checks were successful
Test Rust project / test (ubuntu-latest, stable) (push) Successful in 2m47s
All checks were successful
Test Rust project / test (ubuntu-latest, stable) (push) Successful in 2m47s
This commit is contained in:
parent
620b855f1d
commit
c5cb4eb524
@ -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>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user