fix: Add missing derive(Debug) on adapters

This commit is contained in:
Berkus Decker 2021-10-31 00:37:56 +03:00
parent 156cff7ce5
commit f868152e2f
6 changed files with 11 additions and 5 deletions

View file

@ -38,7 +38,7 @@ use crate::{
/// let myself: Me = bot.get_me().await?; // No .send()!
/// # Ok::<_, teloxide_core::RequestError>(()) };
/// ```
#[derive(Clone)]
#[derive(Clone, Debug)]
pub struct AutoSend<B> {
bot: B,
}

View file

@ -19,7 +19,7 @@ use crate::{
///
/// Bot's user is hardly ever changed, so sometimes it's reasonable to cache
/// response from `get_me` method.
#[derive(Clone)]
#[derive(Clone, Debug)]
pub struct CacheMe<B> {
bot: B,
me: Arc<OnceCell<Me>>,

View file

@ -34,6 +34,12 @@ impl<'a, E> ErasedRequester<'a, E> {
}
}
impl<E> std::fmt::Debug for ErasedRequester<'_, E> {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ErasedRequester").finish_non_exhaustive()
}
}
/// [`Request`] with erased type.
pub struct ErasedRequest<'a, T, E> {
inner: Box<dyn ErasableRequest<'a, Payload = T, Err = E> + 'a>,

View file

@ -8,7 +8,7 @@ use crate::{
/// Default parse mode adaptor, see
/// [`RequesterExt::parse_mode`](crate::requests::RequesterExt::parse_mode).
#[derive(Clone)]
#[derive(Clone, Debug)]
pub struct DefaultParseMode<B> {
bot: B,
mode: ParseMode,

View file

@ -63,7 +63,7 @@ use crate::{
///
/// As such, we encourage not to use `ChatId::ChannelUsername(u)` with this bot
/// wrapper.
#[derive(Clone)]
#[derive(Clone, Debug)]
pub struct Throttle<B> {
bot: B,
// `RequestLock` allows to unlock requests (allowing them to be sent).

View file

@ -25,7 +25,7 @@ use crate::{
/// TRACE teloxide_core::adaptors::trace > Sending `SendDice` request: SendDice { chat_id: Id(0), emoji: Some(Dice), disable_notification: None, reply_to_message_id: None, allow_sending_without_reply: None, reply_markup: None }
/// TRACE teloxide_core::adaptors::trace > Got response from `SendDice` request: Ok(Message { id: 13812, date: 1625926524, chat: Chat { .. }, via_bot: None, kind: Dice(MessageDice { dice: Dice { emoji: Dice, value: 3 } }) })
/// ```
#[derive(Clone)]
#[derive(Clone, Debug)]
pub struct Trace<B> {
inner: B,
settings: Settings,