Compare commits

..
Author SHA1 Message Date
phoenix 766d38ea0e Skipping serialization of fields in Contact (#20)
Release Tagging / release (push) Successful in 40s
Rust Build / Test Suite (push) Successful in 26s
Rust Build / Check (push) Successful in 1m28s
Rust Build / Rustfmt (push) Successful in 26s
Rust Build / Clippy (push) Successful in 40s
Rust Build / build (push) Successful in 1m11s
Reviewed-on: phoenix/textsender-models#20
2026-06-01 22:15:17 -04:00
2 changed files with 8 additions and 12 deletions
+6 -6
View File
@@ -5,14 +5,14 @@ pub struct Contact {
#[serde(skip_serializing_if = "crate::init::is_uuid_nil")]
pub id: Option<uuid::Uuid>,
// empty?
#[serde(skip_serializing_if = "String::is_empty")]
pub firstname: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub firstname: Option<String>,
// empty?
#[serde(skip_serializing_if = "String::is_empty")]
pub lastname: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub lastname: Option<String>,
// empty?
#[serde(skip_serializing_if = "String::is_empty")]
pub nickname: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub nickname: Option<String>,
pub phone_number: String,
// empty
#[serde(skip_serializing_if = "crate::init::is_uuid_nil")]
+2 -6
View File
@@ -8,12 +8,8 @@ pub mod user;
pub mod init {
pub fn is_uuid_nil(uuid: &Option<uuid::Uuid>) -> bool {
match uuid {
Some(id) => {
id.is_nil()
}
None => {
true
}
Some(id) => id.is_nil(),
None => true,
}
}
}