diff --git a/src/core/requests/form_builder.rs b/src/core/requests/form_builder.rs index 93e9001e..66d34530 100644 --- a/src/core/requests/form_builder.rs +++ b/src/core/requests/form_builder.rs @@ -1,10 +1,13 @@ +use std::path::PathBuf; + +use crate::core::{ + types::{ParseMode, InputMedia}, + requests::{ChatId, utils}, +}; + use reqwest::r#async::multipart::Form; use serde::Serialize; -use crate::core::types::ParseMode; -use crate::core::requests::ChatId; -use crate::core::requests::utils; -use crate::core::types::InputMedia; -use std::path::PathBuf; + /// This is a convenient struct that builds `reqwest::r#async::multipart::Form` /// from scratch. diff --git a/src/core/requests/forward_message.rs b/src/core/requests/forward_message.rs index 141d3338..3a286f1c 100644 --- a/src/core/requests/forward_message.rs +++ b/src/core/requests/forward_message.rs @@ -1,7 +1,16 @@ -use crate::core::requests::form_builder::FormBuilder; -use crate::core::requests::{ChatId, RequestContext, Request, RequestFuture, ResponseResult}; -use crate::core::types::Message; -use crate::core::network; +use crate::core::{ + network, + types::Message, + requests::{ + ChatId, + Request, + RequestFuture, + RequestContext, + ResponseResult, + form_builder::FormBuilder, + }, +}; + #[derive(Debug, Clone, Serialize)] /// Use this method to forward messages of any kind. On success, the sent diff --git a/src/core/requests/get_me.rs b/src/core/requests/get_me.rs index aa92a589..fc894ae6 100644 --- a/src/core/requests/get_me.rs +++ b/src/core/requests/get_me.rs @@ -1,8 +1,14 @@ -use crate::core::network; -use crate::core::requests::{ - Request, RequestFuture, RequestContext, ResponseResult, +use crate::core::{ + network, + types::User, + requests::{ + Request, + RequestFuture, + RequestContext, + ResponseResult + }, }; -use crate::core::types::User; + #[derive(Debug, Clone)] /// A simple method for testing your bot's auth token. Requires no parameters. diff --git a/src/core/requests/mod.rs b/src/core/requests/mod.rs index 8d59f64c..1a124ac1 100644 --- a/src/core/requests/mod.rs +++ b/src/core/requests/mod.rs @@ -1,11 +1,14 @@ -use std::future::Future; use std::pin::Pin; +use std::future::Future; -use reqwest::r#async::Client; -use reqwest::StatusCode; +use reqwest::{ + r#async::Client, StatusCode +}; use serde::de::DeserializeOwned; + mod form_builder; +mod utils; #[derive(Debug, Display)] pub enum RequestError { @@ -90,4 +93,3 @@ pub mod send_message; pub mod forward_message; pub mod send_photo; pub mod send_media_group; -mod utils; diff --git a/src/core/requests/send_media_group.rs b/src/core/requests/send_media_group.rs index 72d5a759..9fe58575 100644 --- a/src/core/requests/send_media_group.rs +++ b/src/core/requests/send_media_group.rs @@ -1,13 +1,13 @@ use crate::core::{ - types::{Message, InputMedia, InputFile}, network::request_multipart, + types::{Message, InputMedia, InputFile}, requests::{ - form_builder::FormBuilder, ChatId, Request, - RequestContext, RequestFuture, + RequestContext, ResponseResult, + form_builder::FormBuilder, } }; use apply::Apply; diff --git a/src/core/requests/send_message.rs b/src/core/requests/send_message.rs index dc91377f..c78e77b6 100644 --- a/src/core/requests/send_message.rs +++ b/src/core/requests/send_message.rs @@ -1,6 +1,15 @@ -use crate::core::requests::form_builder::FormBuilder; -use crate::core::requests::{ - ChatId, Request, RequestFuture, RequestContext, ResponseResult, +use crate::core::{ + network, + types::Message, + types::ParseMode, + requests::{ + form_builder::FormBuilder, + ChatId, + Request, + RequestFuture, + RequestContext, + ResponseResult, + }, }; diff --git a/src/core/requests/send_photo.rs b/src/core/requests/send_photo.rs index a2f5c846..948a44e4 100644 --- a/src/core/requests/send_photo.rs +++ b/src/core/requests/send_photo.rs @@ -1,9 +1,18 @@ use std::path::Path; -use crate::core::requests::{RequestContext, ChatId, Request, RequestFuture, ResponseResult}; -use crate::core::types::{ParseMode, Message, InputFile}; -use crate::core::requests::form_builder::FormBuilder; -use crate::core::network; +use crate::core::{ + network, + types::{ParseMode, Message, InputFile}, + requests::{ + ChatId, + Request, + RequestFuture, + RequestContext, + ResponseResult, + form_builder::FormBuilder, + }, +}; + #[derive(Debug, Clone)] /// Use this method to send photos. On success, the sent [`Message`] is returned.