From 71012bb2686ecc7cea38c6e6541d21f4df3c588b Mon Sep 17 00:00:00 2001 From: Veetaha Date: Sun, 1 Sep 2024 20:12:02 +0000 Subject: [PATCH] Remove unnecessary `#[builder(into)]` with a JS script --- src/api_params.rs | 76 -------------------------- src/objects.rs | 133 ---------------------------------------------- 2 files changed, 209 deletions(-) diff --git a/src/api_params.rs b/src/api_params.rs index bf1b3e5..8885631 100644 --- a/src/api_params.rs +++ b/src/api_params.rs @@ -247,7 +247,6 @@ pub struct SetWebhookParams { pub url: String, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub certificate: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -292,14 +291,12 @@ pub struct SendMessageParams { pub text: String, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub parse_mode: Option, #[serde(skip_serializing_if = "Option::is_none")] pub entities: Option>, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub link_preview_options: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -313,11 +310,9 @@ pub struct SendMessageParams { pub message_effect_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_parameters: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_markup: Option, } @@ -382,7 +377,6 @@ pub struct CopyMessageParams { pub caption: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub parse_mode: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -398,11 +392,9 @@ pub struct CopyMessageParams { pub protect_content: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_parameters: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_markup: Option, } @@ -451,7 +443,6 @@ pub struct SendPhotoParams { pub caption: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub parse_mode: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -474,11 +465,9 @@ pub struct SendPhotoParams { pub message_effect_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_parameters: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_markup: Option, } @@ -503,7 +492,6 @@ pub struct SendAudioParams { pub caption: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub parse_mode: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -535,11 +523,9 @@ pub struct SendAudioParams { pub message_effect_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_parameters: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_markup: Option, } @@ -568,7 +554,6 @@ pub struct SendDocumentParams { pub caption: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub parse_mode: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -588,11 +573,9 @@ pub struct SendDocumentParams { pub message_effect_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_parameters: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_markup: Option, } @@ -630,7 +613,6 @@ pub struct SendVideoParams { pub caption: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub parse_mode: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -656,11 +638,9 @@ pub struct SendVideoParams { pub message_effect_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_parameters: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_markup: Option, } @@ -698,7 +678,6 @@ pub struct SendAnimationParams { pub caption: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub parse_mode: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -721,11 +700,9 @@ pub struct SendAnimationParams { pub message_effect_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_parameters: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_markup: Option, } @@ -750,7 +727,6 @@ pub struct SendVoiceParams { pub caption: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub parse_mode: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -770,11 +746,9 @@ pub struct SendVoiceParams { pub message_effect_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_parameters: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_markup: Option, } @@ -815,11 +789,9 @@ pub struct SendVideoNoteParams { pub message_effect_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_parameters: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_markup: Option, } @@ -846,7 +818,6 @@ pub struct SendPaidMediaParams { pub caption: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub parse_mode: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -862,11 +833,9 @@ pub struct SendPaidMediaParams { pub protect_content: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_parameters: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_markup: Option, } @@ -896,7 +865,6 @@ pub struct SendMediaGroupParams { pub protect_content: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_parameters: Option, } @@ -940,11 +908,9 @@ pub struct SendLocationParams { pub message_effect_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_parameters: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_markup: Option, } @@ -983,7 +949,6 @@ pub struct EditMessageLiveLocationParams { pub proximity_alert_radius: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_markup: Option, } @@ -1006,7 +971,6 @@ pub struct StopMessageLiveLocationParams { pub inline_message_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_markup: Option, } @@ -1060,11 +1024,9 @@ pub struct SendVenueParams { pub message_effect_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_parameters: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_markup: Option, } @@ -1106,11 +1068,9 @@ pub struct SendContactParams { pub message_effect_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_parameters: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_markup: Option, } @@ -1131,7 +1091,6 @@ pub struct SendPollParams { pub question: String, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub question_parse_mode: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -1143,7 +1102,6 @@ pub struct SendPollParams { pub is_anonymous: Option, #[serde(rename = "type")] #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub type_field: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -1157,7 +1115,6 @@ pub struct SendPollParams { pub explanation: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub explanation_parse_mode: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -1183,11 +1140,9 @@ pub struct SendPollParams { pub message_effect_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_parameters: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_markup: Option, } @@ -1219,11 +1174,9 @@ pub struct SendDiceParams { pub message_effect_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_parameters: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_markup: Option, } @@ -1802,7 +1755,6 @@ pub struct SetMyCommandsParams { pub commands: Vec, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub scope: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -1874,7 +1826,6 @@ pub struct GetMyShortDescriptionParams { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] pub struct GetMyCommandsParams { #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub scope: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -1886,7 +1837,6 @@ pub struct GetMyCommandsParams { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] pub struct DeleteMyCommandsParams { #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub scope: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -1916,18 +1866,15 @@ pub struct EditMessageTextParams { pub text: String, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub parse_mode: Option, #[serde(skip_serializing_if = "Option::is_none")] pub entities: Option>, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub link_preview_options: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_markup: Option, } @@ -1954,7 +1901,6 @@ pub struct EditMessageCaptionParams { pub caption: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub parse_mode: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -1964,7 +1910,6 @@ pub struct EditMessageCaptionParams { pub show_caption_above_media: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_markup: Option, } @@ -1986,11 +1931,9 @@ pub struct EditMessageMediaParams { #[builder(into)] pub inline_message_id: Option, - #[builder(into)] pub media: InputMedia, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_markup: Option, } @@ -2013,7 +1956,6 @@ pub struct EditMessageReplyMarkupParams { pub inline_message_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_markup: Option, } @@ -2030,7 +1972,6 @@ pub struct StopPollParams { pub message_id: i32, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_markup: Option, } @@ -2083,11 +2024,9 @@ pub struct SendStickerParams { pub message_effect_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_parameters: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_markup: Option, } @@ -2122,7 +2061,6 @@ pub struct CreateNewStickerSetParams { pub stickers: Vec, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub sticker_type: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -2202,7 +2140,6 @@ pub struct SetStickerMaskPositionParams { pub sticker: String, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub mask_position: Option, } @@ -2268,7 +2205,6 @@ pub struct AnswerInlineQueryParams { pub next_offset: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub button: Option, } @@ -2279,7 +2215,6 @@ pub struct InlineQueryResultsButton { pub text: String, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub web_app: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -2373,11 +2308,9 @@ pub struct SendInvoiceParams { pub message_effect_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_parameters: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_markup: Option, } @@ -2526,11 +2459,9 @@ pub struct SendGameParams { pub message_effect_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_parameters: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub reply_markup: Option, } @@ -2585,7 +2516,6 @@ pub struct InputMediaPhoto { pub caption: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub parse_mode: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -2613,7 +2543,6 @@ pub struct InputMediaVideo { pub caption: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub parse_mode: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -2653,7 +2582,6 @@ pub struct InputMediaAnimation { pub caption: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub parse_mode: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -2690,7 +2618,6 @@ pub struct InputMediaAudio { pub caption: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub parse_mode: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -2723,7 +2650,6 @@ pub struct InputMediaDocument { pub caption: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub parse_mode: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -2764,7 +2690,6 @@ pub struct SetChatMenuButtonParams { pub chat_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub menu_button: Option, } @@ -2799,7 +2724,6 @@ pub struct ReplyParameters { pub quote: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub quote_parse_mode: Option, #[serde(skip_serializing_if = "Option::is_none")] diff --git a/src/objects.rs b/src/objects.rs index e08b2ad..637a081 100644 --- a/src/objects.rs +++ b/src/objects.rs @@ -550,26 +550,21 @@ pub struct ChatFullInfo { pub is_forum: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub photo: Option, #[serde(skip_serializing_if = "Option::is_none")] pub active_usernames: Option>, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub birthdate: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub business_intro: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub business_location: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub business_opening_hours: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -632,7 +627,6 @@ pub struct ChatFullInfo { pub pinned_message: Option>, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub permissions: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -674,7 +668,6 @@ pub struct ChatFullInfo { pub linked_chat_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub location: Option, } @@ -765,7 +758,6 @@ pub struct Message { pub entities: Option>, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub link_preview_options: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -913,7 +905,6 @@ pub struct Message { pub connected_website: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub write_access_allowed: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -957,19 +948,15 @@ pub struct Message { pub general_forum_topic_unhidden: Option>, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub giveaway_created: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub giveaway: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub giveaway_winners: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub giveaway_completed: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -1018,7 +1005,6 @@ pub struct MessageEntity { pub url: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub user: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -1049,96 +1035,75 @@ pub struct TextQuote { #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] pub struct ExternalReplyInfo { #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub origin: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub chat: Option, #[serde(skip_serializing_if = "Option::is_none")] pub message_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub link_preview_options: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub animation: Option, #[serde(skip_serializing_if = "Option::is_none")] - #[builder(into)] pub audio: Option