fix doc tests

This commit is contained in:
Waffle 2020-12-28 21:03:33 +03:00
parent 50d3d67f93
commit cf3cd63c92

View file

@ -42,17 +42,17 @@ pub trait Request: HasPayload {
/// ```
/// # async {
/// use teloxide_core::{
/// bot::Bot,
/// methods::GetMe,
/// requests::{Request, RequestJson},
/// payloads::GetMe,
/// requests::{JsonRequest, Request},
/// types::User,
/// Bot,
/// };
///
/// let bot = Bot::new("TOKEN");
/// let method = GetMe::new();
/// let request = JsonRequest::new(bot, method);
/// let _: User = request.send().await.unwrap();
/// # }
/// # };
/// ```
fn send(self) -> Self::Send;
@ -69,17 +69,17 @@ pub trait Request: HasPayload {
/// ## Examples
/// ```
/// # async {
/// use teloxide_core::prelude::*;
/// use teloxide_core::{prelude::*, requests::Request, Bot};
///
/// let bot = Bot::new("TOKEN");
/// # let chat_ids = vec![1, 2, 3, 4].into_iter().map(Into::into);
/// # let chat_ids = vec![1i64, 2, 3, 4].into_iter().map(Into::into);
///
/// let mut req = bot.send_message(0, "Hi there!");
/// for chat_id in chat_ids {
/// req.chat_id = chat_id;
/// req.send_ref().await.unwrap();
/// }
/// # }
/// # };
/// ```
fn send_ref(&self) -> Self::SendRef;
}