skip serializing unimportant fields

This commit is contained in:
beerpsi 2024-01-02 18:26:29 +07:00
parent f34b5ac07f
commit be3b29047c
4 changed files with 8 additions and 5 deletions

3
.cargo/config.toml Normal file
View File

@ -0,0 +1,3 @@
[env]
ICF_KEY = "09ca5efd30c9aaef3804d0a7e3fa7120"
ICF_IV = "b155c22c2e7f0491fa7f0fdc217aff90"

2
Cargo.lock generated
View File

@ -294,7 +294,7 @@ dependencies = [
[[package]]
name = "icf-reader"
version = "0.1.0"
version = "0.1.1"
dependencies = [
"aes",
"anyhow",

View File

@ -1,6 +1,6 @@
[package]
name = "icf-reader"
version = "0.1.0"
version = "0.1.1"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -26,12 +26,12 @@ pub struct IcfInnerData {
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct IcfOptionData {
#[serde(default = "empty_string")]
#[serde(skip, default = "empty_string")]
pub app_id: String,
pub option_id: String,
#[serde(default = "empty_version")]
#[serde(skip, default = "empty_version")]
pub required_system_version: Version,
pub datetime: NaiveDateTime,
@ -39,7 +39,7 @@ pub struct IcfOptionData {
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct IcfPatchData {
#[serde(default = "empty_string")]
#[serde(skip, default = "empty_string")]
pub id: String,
pub sequence_number: u8,