Remove Integer and UnsignedInteger aliases

This commit is contained in:
Waffle 2019-09-04 09:41:44 +03:00
parent d18f7f9666
commit 8b878c3827
6 changed files with 14 additions and 23 deletions

View file

@ -1,9 +1,9 @@
use crate::core::types::{ChatPermissions, ChatPhoto, Message, Integer}; use crate::core::types::{ChatPermissions, ChatPhoto, Message};
#[derive(Debug, Deserialize, Eq, Hash, PartialEq)] #[derive(Debug, Deserialize, Eq, Hash, PartialEq)]
pub struct Chat { pub struct Chat {
pub id: Integer, pub id: i32,
#[serde(flatten)] #[serde(flatten)]
pub type_: ChatType, pub type_: ChatType,
pub photo: Option<ChatPhoto>, pub photo: Option<ChatPhoto>,

View file

@ -1,6 +1,4 @@
use crate::core::types::{ use crate::core::types::{User, ChatMemberStatus};
User, ChatMemberStatus, Integer
};
/// This object contains information about one member of the chat. /// This object contains information about one member of the chat.
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)] #[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
@ -10,7 +8,7 @@ pub struct ChatMember {
/// The member's status in the chat. /// The member's status in the chat.
pub status: ChatMemberStatus, pub status: ChatMemberStatus,
///Optional. Restricted and kicked only. Date when restrictions will be lifted for this user, unix time ///Optional. Restricted and kicked only. Date when restrictions will be lifted for this user, unix time
pub until_date: Option<Integer>, pub until_date: Option<i32>,
///Optional. Administrators only. True, if the bot is allowed to edit administrator privileges of that user ///Optional. Administrators only. True, if the bot is allowed to edit administrator privileges of that user
pub can_be_edited: Option<bool>, pub can_be_edited: Option<bool>,
///Optional. Administrators only. True, if the administrator can change the chat title, photo and other settings ///Optional. Administrators only. True, if the administrator can change the chat title, photo and other settings

View file

@ -1,4 +1,4 @@
use crate::core::types::{PhotoSize, UnsignedInteger}; use crate::core::types::PhotoSize;
#[derive(Debug, Deserialize, Eq, Hash, PartialEq)] #[derive(Debug, Deserialize, Eq, Hash, PartialEq)]
@ -7,5 +7,5 @@ pub struct Document {
pub thumb: Option<PhotoSize>, pub thumb: Option<PhotoSize>,
pub file_name: Option<String>, pub file_name: Option<String>,
pub mime_type: Option<String>, pub mime_type: Option<String>,
pub file_size: Option<UnsignedInteger>, pub file_size: Option<u32>,
} }

View file

@ -1,10 +1,6 @@
use self::not_implemented_types::*; use self::not_implemented_types::*;
pub type Integer = i32;
pub type UnsignedInteger = u32;
pub use self::{ pub use self::{
answer_pre_checkout_query::AnswerPreCheckoutQuery, answer_pre_checkout_query::AnswerPreCheckoutQuery,
answer_shipping_query::AnswerShippingQuery, answer_shipping_query::AnswerShippingQuery,

View file

@ -1,10 +1,7 @@
use crate::core::types::{Integer, UnsignedInteger};
#[derive(Debug, Deserialize, Eq, Hash, PartialEq, Serialize)] #[derive(Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
pub struct PhotoSize { pub struct PhotoSize {
pub file_id: String, pub file_id: String,
pub width: Integer, pub width: i32,
pub heigth: Integer, pub heigth: i32,
pub file_size: Option<UnsignedInteger> pub file_size: Option<u32>
} }

View file

@ -1,13 +1,13 @@
use crate::core::types::{PhotoSize, UnsignedInteger}; use crate::core::types::PhotoSize;
#[derive(Debug, Deserialize, Eq, Hash, PartialEq, Serialize)] #[derive(Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
pub struct Video { pub struct Video {
pub file_id: String, pub file_id: String,
pub width: UnsignedInteger, pub width: u32,
pub height: UnsignedInteger, pub height: u32,
pub duration: UnsignedInteger, pub duration: u32,
pub thumb: Option<PhotoSize>, pub thumb: Option<PhotoSize>,
pub mime_type: Option<String>, pub mime_type: Option<String>,
pub file_size: Option<UnsignedInteger> pub file_size: Option<u32>
} }