From 5afbef57340805df883b56f2f3f5f5c22d51053a Mon Sep 17 00:00:00 2001 From: Temirkhan Myrzamadi Date: Wed, 29 Jul 2020 03:38:11 +0600 Subject: [PATCH] SendDiceEmoji -> DiceEmoji --- src/requests/all/send_dice.rs | 6 +++--- src/types/dice.rs | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/requests/all/send_dice.rs b/src/requests/all/send_dice.rs index 2fde55c6..a85aeb78 100644 --- a/src/requests/all/send_dice.rs +++ b/src/requests/all/send_dice.rs @@ -16,7 +16,7 @@ pub struct SendDice { chat_id: ChatId, #[serde(flatten)] - emoji: Option, + emoji: Option, disable_notification: Option, reply_to_message_id: Option, reply_markup: Option, @@ -57,7 +57,7 @@ impl SendDice { } /// Emoji on which the dice throw animation is based. - pub fn emoji(mut self, val: SendDiceEmoji) -> Self { + pub fn emoji(mut self, val: DiceEmoji) -> Self { self.emoji = Some(val); self } @@ -92,7 +92,7 @@ impl SendDice { } #[derive(Copy, Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)] -pub enum SendDiceEmoji { +pub enum DiceEmoji { /// Values from 1-6. Defaults to this variant. #[serde(rename = "🎲")] Dice, diff --git a/src/types/dice.rs b/src/types/dice.rs index b0354d2b..eb007db9 100644 --- a/src/types/dice.rs +++ b/src/types/dice.rs @@ -1,6 +1,6 @@ use serde::{Deserialize, Serialize}; -use crate::requests::SendDiceEmoji; +use crate::requests::DiceEmoji; /// This object represents an animated emoji that displays a random value. #[serde_with_macros::skip_serializing_none] @@ -8,25 +8,25 @@ use crate::requests::SendDiceEmoji; #[non_exhaustive] pub struct Dice { /// Emoji on which the dice throw animation is based. - emoji: SendDiceEmoji, + emoji: DiceEmoji, /// Value of the dice. /// - /// 1-6 for [`SendDiceEmoji::Dice`] and [`SendDiceEmoji::Darts`], 1-5 for - /// [`SendDiceEmoji::Basketball`]. + /// 1-6 for [`DiceEmoji::Dice`] and [`DiceEmoji::Darts`], 1-5 for + /// [`DiceEmoji::Basketball`]. /// - /// [`SendDiceEmoji::Dice`]: crate::types::SendDiceEmoji::Dice - /// [`SendDiceEmoji::Darts`]:crate::types::SendDiceEmoji::Darts - /// [`SendDiceEmoji::Basketball`]:crate::types::SendDiceEmoji::Basketball + /// [`DiceEmoji::Dice`]: crate::types::DiceEmoji::Dice + /// [`DiceEmoji::Darts`]:crate::types::DiceEmoji::Darts + /// [`DiceEmoji::Basketball`]:crate::types::DiceEmoji::Basketball value: i32, } impl Dice { - pub fn new(emoji: SendDiceEmoji, value: i32) -> Self { + pub fn new(emoji: DiceEmoji, value: i32) -> Self { Self { emoji, value } } - pub fn emoji(mut self, val: SendDiceEmoji) -> Self { + pub fn emoji(mut self, val: DiceEmoji) -> Self { self.emoji = val; self }