diff --git a/src/bots/approved_bot/modules/book.rs b/src/bots/approved_bot/modules/book.rs index 2f08a0b..442cf3c 100644 --- a/src/bots/approved_bot/modules/book.rs +++ b/src/bots/approved_bot/modules/book.rs @@ -1,3 +1,4 @@ +use core::fmt::Debug; use std::str::FromStr; use moka::future::Cache; @@ -121,8 +122,8 @@ async fn send_book_handler( user_langs_cache: Cache>, ) -> crate::bots::BotHandlerInternal where - T: Format + Clone, - P: FormatTitle + Clone, + T: Format + Clone + Debug, + P: FormatTitle + Clone + Debug, Fut: std::future::Future, Box>>, { let id = match command { @@ -198,8 +199,8 @@ async fn send_pagination_book_handler( user_langs_cache: Cache>, ) -> crate::bots::BotHandlerInternal where - T: Format + Clone, - P: FormatTitle + Clone, + T: Format + Clone + Debug, + P: FormatTitle + Clone + Debug, Fut: std::future::Future, Box>>, { let (id, page) = match callback_data { diff --git a/src/bots/approved_bot/modules/search.rs b/src/bots/approved_bot/modules/search.rs index d645677..119143e 100644 --- a/src/bots/approved_bot/modules/search.rs +++ b/src/bots/approved_bot/modules/search.rs @@ -1,3 +1,4 @@ +use core::fmt::Debug; use std::str::FromStr; use moka::future::Cache; @@ -114,8 +115,8 @@ async fn generic_search_pagination_handler( user_langs_cache: Cache>, ) -> BotHandlerInternal where - T: Format + Clone, - P: FormatTitle + Clone, + T: Format + Clone + Debug, + P: FormatTitle + Clone + Debug, Fut: std::future::Future, Box>>, { let chat_id = cq.chat_id(); diff --git a/src/bots/approved_bot/services/book_library/types.rs b/src/bots/approved_bot/services/book_library/types.rs index 9f712e9..fc40a0f 100644 --- a/src/bots/approved_bot/services/book_library/types.rs +++ b/src/bots/approved_bot/services/book_library/types.rs @@ -1,3 +1,4 @@ +use core::fmt::Debug; use serde::Deserialize; use super::formaters::{Format, FormatResult, FormatTitle}; @@ -90,16 +91,18 @@ pub struct Page { impl Page where - T: Format + Clone, - P: FormatTitle + Clone + T: Format + Clone + Debug, + P: FormatTitle + Clone + Debug { pub fn format_items(&self, max_size: usize) -> String { + log::error!("format: {:?}", self); + let title: String = match &self.parent_item { Some(parent_item) => { let item_title = parent_item.format_title(); if item_title.is_empty() { - return "".to_string(); + return item_title; } format!("{item_title}\n\n\n")