Fix recursive types

This commit is contained in:
Temirkhan Myrzamadi 2019-09-02 12:58:42 +06:00
parent cd7982ec29
commit bdaca41eda
4 changed files with 19 additions and 24 deletions

View file

@ -1,5 +1,3 @@
use reqwest::r#async::Client;
mod games; mod games;
mod getting_updates; mod getting_updates;
mod inline_mode; mod inline_mode;

View file

@ -22,16 +22,16 @@ pub struct Chat {
photo: Option<ChatPhoto>, photo: Option<ChatPhoto>,
description: Option<String>, description: Option<String>,
invite_link: Option<String>, invite_link: Option<String>,
pinned_message: Option<Message>, pinned_message: Option<Box<Message>>,
permissions: Option<ChatPermissions>, permissions: Option<ChatPermissions>,
sticker_set_name: Option<String>, sticker_set_name: Option<String>,
can_set_sticker_set: Option<Bool>, can_set_sticker_set: Option<bool>,
} }
#[derive(Debug, Deserialize)] #[derive(Debug, Deserialize)]
pub struct Message { pub struct Message {
message_id: i64, message_id: i64,
from: Option<User>, from: Option<Box<User>>,
date: i64, date: i64,
chat: Chat, chat: Chat,
forward_from: Option<User>, forward_from: Option<User>,
@ -40,7 +40,7 @@ pub struct Message {
forward_signature: Option<String>, forward_signature: Option<String>,
forward_sender_name: Option<String>, forward_sender_name: Option<String>,
forward_date: Option<i64>, forward_date: Option<i64>,
reply_to_message: Option<Message>, reply_to_message: Option<Box<Message>>,
edit_date: Option<i64>, edit_date: Option<i64>,
media_group_id: Option<String>, media_group_id: Option<String>,
author_signature: Option<String>, author_signature: Option<String>,
@ -65,13 +65,13 @@ pub struct Message {
left_chat_member: Option<User>, left_chat_member: Option<User>,
new_chat_title: Option<String>, new_chat_title: Option<String>,
new_chat_photo: Option<Vec<PhotoSize>>, new_chat_photo: Option<Vec<PhotoSize>>,
delete_chat_photo: Option<Bool>, delete_chat_photo: Option<bool>,
group_chat_created: Option<Bool>, group_chat_created: Option<bool>,
supergroup_chat_created: Option<Bool>, supergroup_chat_created: Option<bool>,
channel_chat_created: Option<Bool>, channel_chat_created: Option<bool>,
migrate_to_chat_id: Option<i64>, migrate_to_chat_id: Option<i64>,
migrate_from_chat_id: Option<i64>, migrate_from_chat_id: Option<i64>,
pinned_message: Optional<Message>, pinned_message: Option<Box<Message>>,
invoice: Option<Invoice>, invoice: Option<Invoice>,
successful_payment: Option<SuccessfulPayment>, successful_payment: Option<SuccessfulPayment>,
connected_website: Option<String>, connected_website: Option<String>,

View file

@ -19,14 +19,14 @@ pub struct SendInvoice {
photo_size: Option<i64>, photo_size: Option<i64>,
photo_width: Option<i64>, photo_width: Option<i64>,
photo_height: Option<i64>, photo_height: Option<i64>,
need_name: Option<Bool>, need_name: Option<bool>,
need_phone_number: Option<Bool>, need_phone_number: Option<bool>,
need_email: Option<Bool>, need_email: Option<bool>,
need_shipping_address: Option<Bool>, need_shipping_address: Option<bool>,
send_phone_number_to_provider: Option<Bool>, send_phone_number_to_provider: Option<bool>,
send_email_to_provider: Option<Bool>, send_email_to_provider: Option<bool>,
is_flexible: Option<Bool>, is_flexible: Option<bool>,
disable_notification: Option<Bool>, disable_notification: Option<bool>,
reply_to_message_id: Option<i64>, reply_to_message_id: Option<i64>,
reply_markup: Option<InlineKeyboardMarkup>, reply_markup: Option<InlineKeyboardMarkup>,
} }
@ -34,7 +34,7 @@ pub struct SendInvoice {
#[derive(Debug, Deserialize)] #[derive(Debug, Deserialize)]
pub struct AnswerShippingQuery { pub struct AnswerShippingQuery {
shipping_query_id: String, shipping_query_id: String,
ok: Bool, ok: bool,
shipping_options: Option<Vec<ShippingOption>>, shipping_options: Option<Vec<ShippingOption>>,
error_message: Option<String>, error_message: Option<String>,
} }
@ -42,7 +42,7 @@ pub struct AnswerShippingQuery {
#[derive(Debug, Deserialize)] #[derive(Debug, Deserialize)]
pub struct AnswerPreCheckoutQuery { pub struct AnswerPreCheckoutQuery {
pre_checkout_query_id: String, pre_checkout_query_id: String,
ok: Bool, ok: bool,
error_message: Option<String>, error_message: Option<String>,
} }

View file

@ -1,6 +1,3 @@
#![feature(async_await)] #![feature(async_await)]
#[macro_use]
extern crate lazy_static;
mod core; mod core;