Fixing issue with Contact fields
Rust Build / Check (pull_request) Successful in 40s
Rust Build / Test Suite (pull_request) Successful in 28s
Rust Build / Rustfmt (pull_request) Successful in 36s
Rust Build / build (pull_request) Successful in 28s
Rust Build / Clippy (pull_request) Successful in 44s
Release Tagging / release (pull_request) Successful in 27s
Rust Build / Check (pull_request) Successful in 40s
Rust Build / Test Suite (pull_request) Successful in 28s
Rust Build / Rustfmt (pull_request) Successful in 36s
Rust Build / build (pull_request) Successful in 28s
Rust Build / Clippy (pull_request) Successful in 44s
Release Tagging / release (pull_request) Successful in 27s
This commit is contained in:
+6
-6
@@ -5,14 +5,14 @@ pub struct Contact {
|
|||||||
#[serde(skip_serializing_if = "crate::init::is_uuid_nil")]
|
#[serde(skip_serializing_if = "crate::init::is_uuid_nil")]
|
||||||
pub id: Option<uuid::Uuid>,
|
pub id: Option<uuid::Uuid>,
|
||||||
// empty?
|
// empty?
|
||||||
#[serde(skip_serializing_if = "String::is_empty")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub firstname: String,
|
pub firstname: Option<String>,
|
||||||
// empty?
|
// empty?
|
||||||
#[serde(skip_serializing_if = "String::is_empty")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub lastname: String,
|
pub lastname: Option<String>,
|
||||||
// empty?
|
// empty?
|
||||||
#[serde(skip_serializing_if = "String::is_empty")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub nickname: String,
|
pub nickname: Option<String>,
|
||||||
pub phone_number: String,
|
pub phone_number: String,
|
||||||
// empty
|
// empty
|
||||||
#[serde(skip_serializing_if = "crate::init::is_uuid_nil")]
|
#[serde(skip_serializing_if = "crate::init::is_uuid_nil")]
|
||||||
|
|||||||
+2
-6
@@ -8,12 +8,8 @@ pub mod user;
|
|||||||
pub mod init {
|
pub mod init {
|
||||||
pub fn is_uuid_nil(uuid: &Option<uuid::Uuid>) -> bool {
|
pub fn is_uuid_nil(uuid: &Option<uuid::Uuid>) -> bool {
|
||||||
match uuid {
|
match uuid {
|
||||||
Some(id) => {
|
Some(id) => id.is_nil(),
|
||||||
id.is_nil()
|
None => true,
|
||||||
}
|
|
||||||
None => {
|
|
||||||
true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user