diff --git a/examples/self_info.rs b/examples/self_info.rs index 6349b76a..e3747671 100644 --- a/examples/self_info.rs +++ b/examples/self_info.rs @@ -13,8 +13,7 @@ async fn main() -> Result<(), Box> { .parse::()?, ); - let bot = Bot::from_env() - .parse_mode(ParseMode::MarkdownV2); + let bot = Bot::from_env().parse_mode(ParseMode::MarkdownV2); let Me { user: me, .. } = bot.get_me().await?; diff --git a/src/adaptors.rs b/src/adaptors.rs index 142bc4e9..c54a65ec 100644 --- a/src/adaptors.rs +++ b/src/adaptors.rs @@ -5,13 +5,16 @@ //! //! [`Requester`]: crate::requests::Requester -/// [`AutoSend`] bot adaptor which used to allow sending a request without calling -/// [`send`]. +/// [`AutoSend`] bot adaptor which used to allow sending a request without +/// calling [`send`]. /// /// [`AutoSend`]: auto_send::AutoSend /// [`send`]: crate::requests::Request::send #[cfg(feature = "auto_send")] -#[deprecated(since = "0.8.0", note = "`AutoSend` is no longer required to `.await` requests and is now noop")] +#[deprecated( + since = "0.8.0", + note = "`AutoSend` is no longer required to `.await` requests and is now noop" +)] pub mod auto_send; /// [`CacheMe`] bot adaptor which caches [`GetMe`] requests. diff --git a/src/adaptors/auto_send.rs b/src/adaptors/auto_send.rs index 878e64ff..dfd4a4c8 100644 --- a/src/adaptors/auto_send.rs +++ b/src/adaptors/auto_send.rs @@ -12,10 +12,10 @@ use crate::{ /// Before addition of [`IntoFuture`] you could only `.await` [`Future`]s. /// This adaptor turned requests into futures, allowing to `.await` them, /// without calling `.send()`. -/// +/// /// Now, however, all requests are required to implement `IntoFuture`, allowing /// you to `.await` them directly. This adaptor is noop, and shouldn't be used. -/// +/// /// [`Future`]: std::future::Future #[derive(Clone, Debug)] pub struct AutoSend { diff --git a/src/adaptors/cache_me.rs b/src/adaptors/cache_me.rs index 9d75deaf..5ae8669a 100644 --- a/src/adaptors/cache_me.rs +++ b/src/adaptors/cache_me.rs @@ -1,5 +1,4 @@ -use std::{pin::Pin, sync::Arc}; -use std::future::IntoFuture; +use std::{future::IntoFuture, pin::Pin, sync::Arc}; use futures::{ future, diff --git a/src/requests/request.rs b/src/requests/request.rs index 578a050c..d39c9d64 100644 --- a/src/requests/request.rs +++ b/src/requests/request.rs @@ -41,7 +41,7 @@ where /// Send this request. /// /// ## Examples - /// + /// /// ``` /// # async { /// use teloxide_core::{ @@ -57,7 +57,7 @@ where /// let method = GetMe::new(); /// let request = JsonRequest::new(bot, method); /// let _: Me = request.send().await.unwrap(); - /// + /// /// // You can also just await requests, without calling `send`: /// let method = GetMe::new(); /// let request = JsonRequest::new(bot, method); @@ -78,7 +78,7 @@ where /// and then serializing it, this method should just serialize the data.) /// /// ## Examples - /// + /// /// ``` /// # async { /// use teloxide_core::{prelude::*, requests::Request, types::ChatId, Bot}; @@ -105,7 +105,8 @@ where } } -// FIXME: re-introduce `Either` impls once `Either: IntoFuture` (or make out own `Either`) (same for `Requester`) +// FIXME: re-introduce `Either` impls once `Either: IntoFuture` (or make out own +// `Either`) (same for `Requester`) // impl Request for Either // where diff --git a/src/requests/requester_ext.rs b/src/requests/requester_ext.rs index 0af1faae..35509409 100644 --- a/src/requests/requester_ext.rs +++ b/src/requests/requester_ext.rs @@ -29,7 +29,10 @@ pub trait RequesterExt: Requester { /// Send requests automatically, see [`AutoSend`] for more. #[cfg(feature = "auto_send")] - #[deprecated(since = "0.8.0", note = "`AutoSend` is no longer required to `.await` requests and is now noop")] + #[deprecated( + since = "0.8.0", + note = "`AutoSend` is no longer required to `.await` requests and is now noop" + )] #[allow(deprecated)] fn auto_send(self) -> AutoSend where