fix: fallback to empty string when deserialising

This commit is contained in:
Paul Makles
2023-05-25 11:25:25 +01:00
parent df8f588e15
commit 101e8feaa2

View File

@@ -76,7 +76,7 @@ auto_derived!(
/// User's active status /// User's active status
pub struct UserStatus { pub struct UserStatus {
/// Custom status text /// Custom status text
#[serde(skip_serializing_if = "String::is_empty")] #[serde(skip_serializing_if = "String::is_empty", default)]
pub text: String, pub text: String,
/// Current presence option /// Current presence option
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
@@ -86,7 +86,7 @@ auto_derived!(
/// User's profile /// User's profile
pub struct UserProfile { pub struct UserProfile {
/// Text content on user's profile /// Text content on user's profile
#[serde(skip_serializing_if = "String::is_empty")] #[serde(skip_serializing_if = "String::is_empty", default)]
pub content: String, pub content: String,
/// Background visible on user's profile /// Background visible on user's profile
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]