Skip to content

Commit

Permalink
refactor: use rename_all over rename
Browse files Browse the repository at this point in the history
  • Loading branch information
EdJoPaTo committed Sep 17, 2024
1 parent 36ad72f commit 7161cd7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
17 changes: 2 additions & 15 deletions src/api_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,40 +97,27 @@ pub enum InlineQueryResult {
}

#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(tag = "type")]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum InputMedia {
#[serde(rename = "animation")]
Animation(InputMediaAnimation),
#[serde(rename = "document")]
Document(InputMediaDocument),
#[serde(rename = "audio")]
Audio(InputMediaAudio),
#[serde(rename = "photo")]
Photo(InputMediaPhoto),
#[serde(rename = "video")]
Video(InputMediaVideo),
}

#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(tag = "source")]
#[serde(tag = "source", rename_all = "snake_case")]
pub enum PassportElementError {
#[serde(rename = "data")]
DataField(PassportElementErrorDataField),
#[serde(rename = "front_side")]
FrontSide(PassportElementErrorFrontSide),
#[serde(rename = "reverse_side")]
ReverseSide(PassportElementErrorReverseSide),
#[serde(rename = "selfie")]
Selfie(PassportElementErrorSelfie),
#[serde(rename = "file")]
File(PassportElementErrorFile),
#[serde(rename = "files")]
Files(PassportElementErrorFiles),
#[serde(rename = "translation_file")]
TranslationFile(PassportElementErrorTranslationFile),
#[serde(rename = "translation_files")]
TranslationFiles(PassportElementErrorTranslationFiles),
#[serde(rename = "unspecified")]
Unspecified(PassportElementErrorUnspecified),
}

Expand Down
1 change: 0 additions & 1 deletion src/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,6 @@ pub struct Story {
pub struct StickerSet {
pub name: String,
pub title: String,
#[serde(rename = "sticker_type")]
pub sticker_type: StickerType,
#[doc(hidden)]
#[deprecated(since = "0.19.2", note = "Please use `sticker_type` instead")]
Expand Down

0 comments on commit 7161cd7

Please sign in to comment.