Fix request:: imports (&cargo fmt)

This commit is contained in:
Waffle 2019-09-21 02:07:05 +03:00
parent 14b866db4c
commit 5ea1673903
8 changed files with 47 additions and 34 deletions

View file

@ -1,12 +1,9 @@
use crate::{
bot::Bot,
requests::{
edit_message_live_location::EditMessageLiveLocation,
forward_message::ForwardMessage, get_file::GetFile, get_me::GetMe,
send_audio::SendAudio, send_location::SendLocation,
send_media_group::SendMediaGroup, send_message::SendMessage,
send_photo::SendPhoto,
stop_message_live_location::StopMessageLiveLocation, ChatId,
ChatId, EditMessageLiveLocation, ForwardMessage, GetFile, GetMe,
SendAudio, SendLocation, SendMediaGroup, SendMessage, SendPhoto,
StopMessageLiveLocation,
},
types::{InputFile, InputMedia},
};

View file

@ -1,10 +1,10 @@
use bytes::Buf;
use futures::StreamExt;
use reqwest::r#async::{Chunk, Client};
use tokio::{
io::{AsyncWrite, AsyncWriteExt},
stream::Stream,
};
use bytes::Buf;
use crate::{
network::{file_url, TELEGRAM_API_URL},

View file

@ -3,7 +3,7 @@ use reqwest::r#async::{multipart::Form, Client, Response};
use serde::{de::DeserializeOwned, Serialize};
use crate::{
network::{method_url, TELEGRAM_API_URL, TelegramResponse},
network::{method_url, TelegramResponse, TELEGRAM_API_URL},
requests::ResponseResult,
RequestError,
};

View file

@ -5,7 +5,7 @@ use crate::requests::RequestContext;
///Use this method to get a list of profile pictures for a user. Returns a
/// UserProfilePhotos object.
#[derive(Debug, Clone, Serialize)]
struct GetUserProfilePhotos<'a> {
pub struct GetUserProfilePhotos<'a> {
#[serde(skip_serializing)]
ctx: RequestContext<'a>,
/// Unique identifier of the target user

View file

@ -6,7 +6,7 @@ use crate::requests::RequestContext;
/// bot must be an administrator in the chat for this to work and must have the
/// appropriate admin rights. Returns True on success.
#[derive(Debug, Clone, Serialize)]
struct KickChatMember<'a> {
pub struct KickChatMember<'a> {
#[serde(skip_serializing)]
ctx: RequestContext<'a>,
}

View file

@ -7,6 +7,22 @@ use std::{future::Future, pin::Pin};
use crate::RequestError;
pub use self::{
answer_pre_checkout_query::AnswerPreCheckoutQuery,
answer_shipping_query::AnswerShippingQuery,
edit_message_live_location::EditMessageLiveLocation,
forward_message::ForwardMessage, get_chat::GetChat, get_file::GetFile,
get_me::GetMe, get_updates::GetUpdates,
get_user_profile_photos::GetUserProfilePhotos,
kick_chat_member::KickChatMember, restrict_chat_member::RestrictChatMember,
send_audio::SendAudio, send_chat_action::SendChatAction,
send_contact::SendContact, send_location::SendLocation,
send_media_group::SendMediaGroup, send_message::SendMessage,
send_photo::SendPhoto, send_poll::SendPoll, send_venue::SendVenue,
stop_message_live_location::StopMessageLiveLocation,
unban_chat_member::UnbanChatMember,
};
pub type ResponseResult<T> = Result<T, RequestError>;
/// Request that can be sent to telegram.
@ -63,25 +79,25 @@ mod tests {
}
}
pub mod answer_pre_checkout_query;
pub mod answer_shipping_query;
pub mod edit_message_live_location;
pub mod forward_message;
pub mod get_chat;
pub mod get_file;
pub mod get_me;
pub mod get_updates;
pub mod get_user_profile_photos;
pub mod kick_chat_member;
pub mod restrict_chat_member;
pub mod send_audio;
pub mod send_chat_action;
pub mod send_contact;
pub mod send_location;
pub mod send_media_group;
pub mod send_message;
pub mod send_photo;
pub mod send_poll;
pub mod send_venue;
pub mod stop_message_live_location;
pub mod unban_chat_member;
mod answer_pre_checkout_query;
mod answer_shipping_query;
mod edit_message_live_location;
mod forward_message;
mod get_chat;
mod get_file;
mod get_me;
mod get_updates;
mod get_user_profile_photos;
mod kick_chat_member;
mod restrict_chat_member;
mod send_audio;
mod send_chat_action;
mod send_contact;
mod send_location;
mod send_media_group;
mod send_message;
mod send_photo;
mod send_poll;
mod send_venue;
mod stop_message_live_location;
mod unban_chat_member;

View file

@ -2,7 +2,7 @@ use crate::requests::RequestContext;
//TODO:: need implementation
#[derive(Debug, Clone, Serialize)]
struct RestrictChatMember<'a> {
pub struct RestrictChatMember<'a> {
#[serde(skip_serializing)]
ctx: RequestContext<'a>,
}

View file

@ -2,7 +2,7 @@ use crate::requests::RequestContext;
//TODO:: need implementation
#[derive(Debug, Clone, Serialize)]
struct UnbanChatMember<'a> {
pub struct UnbanChatMember<'a> {
#[serde(skip_serializing)]
ctx: RequestContext<'a>,
}