Skip to content

Commit

Permalink
Add missing #[skip_serializing_none]
Browse files Browse the repository at this point in the history
  • Loading branch information
Desiders committed Aug 14, 2024
1 parent c0c38f2 commit c0856c2
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion telers/src/types/background_type_chat_theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ use serde::{Deserialize, Serialize};
pub struct BackgroundTypeChatTheme {
/// Name of the chat theme, which is usually an emoji
#[serde(rename = "theme_name")]
pub name: String,
pub name: Box<str>,
}
2 changes: 2 additions & 0 deletions telers/src/types/birthdate.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use serde::{Deserialize, Serialize};
use serde_with::skip_serializing_none;

/// # Documentation
/// <https://core.telegram.org/bots/api#birthdate>
#[skip_serializing_none]
#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)]
pub struct Birthdate {
/// Day of the user's birth; 1-31
Expand Down
2 changes: 2 additions & 0 deletions telers/src/types/chat_member_member.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
use super::User;

use serde::{Deserialize, Serialize};
use serde_with::skip_serializing_none;

/// Represents a [`ChatMember`](crate::types::ChatMember) that has no additional privileges or restrictions.
/// # Documentation
/// <https://core.telegram.org/bots/api#chatmembermember>
#[skip_serializing_none]
#[derive(Debug, Clone, Hash, PartialEq, Eq, Deserialize, Serialize)]
pub struct ChatMemberMember {
/// Information about the user
Expand Down
2 changes: 2 additions & 0 deletions telers/src/types/input_paid_media_video.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
use super::InputFile;

use serde::Serialize;
use serde_with::skip_serializing_none;

/// The paid media to send is a video.
/// # Documentation
/// <https://core.telegram.org/bots/api#inputpaidmediavideo>
#[skip_serializing_none]
#[derive(Debug, Clone, Hash, PartialEq, Serialize)]
pub struct InputPaidMediaVideo<'a> {
/// File to send. Pass a `file_id` to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass `attach://<file_attach_name>` to upload a new one using `multipart/form-data` under `<file_attach_name>` name. [`More information on Sending Files`](https://core.telegram.org/bots/api#sending-files).
Expand Down
4 changes: 3 additions & 1 deletion telers/src/types/poll_option.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use super::MessageEntity;

use serde::{Deserialize, Serialize};
use serde_with::skip_serializing_none;

Expand All @@ -10,7 +12,7 @@ pub struct PollOption {
/// Option text, 1-100 characters
pub text: Box<str>,
/// Special entities that appear in the option text. Currently, only custom emoji entities are allowed in poll option texts
pub entities: Option<Box<[crate::types::MessageEntity]>>,
pub entities: Option<Box<[MessageEntity]>>,
/// Number of users that voted for this option
pub voter_count: i64,
}
2 changes: 2 additions & 0 deletions telers/src/types/refunded_payment.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use serde::{Deserialize, Serialize};
use serde_with::skip_serializing_none;

/// This object contains basic information about a refunded payment.
/// # Documentation
/// <https://core.telegram.org/bots/api#refundedpayment>
#[skip_serializing_none]
#[derive(Debug, Clone, Hash, PartialEq, Eq, Deserialize, Serialize)]
pub struct RefundedPayment {
/// Three-letter ISO 4217 [`currency`](https://core.telegram.org/bots/payments#supported-currencies) code, or `XTR` for payments in [`Telegram Stars`](https://t.me/BotNews/90). Currently, always `XTR`
Expand Down

0 comments on commit c0856c2

Please sign in to comment.