From be6e72bad3789562a7ca8ee2bc0772df73235119 Mon Sep 17 00:00:00 2001 From: Aakash Hemadri Date: Thu, 25 Mar 2021 12:29:39 +0530 Subject: [PATCH] fix: Replace Option> with Vec Signed-off-by: Aakash Hemadri --- influxdb2_client/src/models/bucket.rs | 8 ++++---- influxdb2_client/src/models/organization.rs | 4 ++-- influxdb2_client/src/models/user.rs | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/influxdb2_client/src/models/bucket.rs b/influxdb2_client/src/models/bucket.rs index 80f9ad11a0..9b24c987f6 100644 --- a/influxdb2_client/src/models/bucket.rs +++ b/influxdb2_client/src/models/bucket.rs @@ -35,8 +35,8 @@ pub struct Bucket { /// Rules to expire or retain data. No rules means data never expires. pub retention_rules: Vec, /// Bucket labels - #[serde(skip_serializing_if = "Option::is_none")] - pub labels: Option>, + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub labels: Vec, } impl Bucket { @@ -99,8 +99,8 @@ pub struct Buckets { #[serde(skip_serializing_if = "Option::is_none")] pub links: Option, /// Buckets - #[serde(skip_serializing_if = "Option::is_none")] - pub buckets: Option>, + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub buckets: Vec, } impl Buckets { diff --git a/influxdb2_client/src/models/organization.rs b/influxdb2_client/src/models/organization.rs index 26d84c1d7f..f116cfb4ba 100644 --- a/influxdb2_client/src/models/organization.rs +++ b/influxdb2_client/src/models/organization.rs @@ -91,8 +91,8 @@ pub struct Organizations { #[serde(skip_serializing_if = "Option::is_none")] pub links: Option, /// List of organizations - #[serde(skip_serializing_if = "Option::is_none")] - pub orgs: Option>, + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub orgs: Vec, } impl Organizations { diff --git a/influxdb2_client/src/models/user.rs b/influxdb2_client/src/models/user.rs index a51aa556de..2ed69734ff 100644 --- a/influxdb2_client/src/models/user.rs +++ b/influxdb2_client/src/models/user.rs @@ -63,8 +63,8 @@ pub struct Users { #[serde(skip_serializing_if = "Option::is_none")] pub links: Option, /// List of users - #[serde(skip_serializing_if = "Option::is_none")] - pub users: Option>, + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub users: Vec, } impl Users {