Update serde attrs in room

This commit is contained in:
Jonas Platte 2020-05-01 12:38:48 +02:00
parent a19401c076
commit f758a93d70
No known key found for this signature in database
GPG Key ID: 7D261D771D915378

View File

@ -31,13 +31,11 @@ pub mod topic;
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)] #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
pub struct ImageInfo { pub struct ImageInfo {
/// The height of the image in pixels. /// The height of the image in pixels.
#[serde(rename = "h")] #[serde(rename = "h", skip_serializing_if = "Option::is_none")]
#[serde(skip_serializing_if = "Option::is_none")]
pub height: Option<UInt>, pub height: Option<UInt>,
/// The width of the image in pixels. /// The width of the image in pixels.
#[serde(rename = "w")] #[serde(rename = "w", skip_serializing_if = "Option::is_none")]
#[serde(skip_serializing_if = "Option::is_none")]
pub width: Option<UInt>, pub width: Option<UInt>,
/// The MIME type of the image, e.g. "image/png." /// The MIME type of the image, e.g. "image/png."
@ -65,13 +63,11 @@ pub struct ImageInfo {
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)] #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
pub struct ThumbnailInfo { pub struct ThumbnailInfo {
/// The height of the thumbnail in pixels. /// The height of the thumbnail in pixels.
#[serde(rename = "h")] #[serde(rename = "h", skip_serializing_if = "Option::is_none")]
#[serde(skip_serializing_if = "Option::is_none")]
pub height: Option<UInt>, pub height: Option<UInt>,
/// The width of the thumbnail in pixels. /// The width of the thumbnail in pixels.
#[serde(rename = "w")] #[serde(rename = "w", skip_serializing_if = "Option::is_none")]
#[serde(skip_serializing_if = "Option::is_none")]
pub width: Option<UInt>, pub width: Option<UInt>,
/// The MIME type of the thumbnail, e.g. "image/png." /// The MIME type of the thumbnail, e.g. "image/png."