diff --git a/src/api_params.rs b/src/api_params.rs index e89e411..a1ce5e2 100644 --- a/src/api_params.rs +++ b/src/api_params.rs @@ -2,10 +2,9 @@ use std::path::PathBuf; -use macro_rules_attribute::apply; use serde::{Deserialize, Serialize}; -use crate::macros::apistruct; +use crate::macros::{apistruct, apply}; use crate::objects::{ AllowedUpdate, BotCommand, ChatAdministratorRights, ChatPermissions, ForceReply, InlineKeyboardMarkup, InlineQueryResultArticle, InlineQueryResultAudio, diff --git a/src/lib.rs b/src/lib.rs index 4b262fc..1838815 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,6 +27,7 @@ mod client_ureq; mod error; #[cfg(any(feature = "http-client", feature = "async-http-client"))] mod json; +mod macros; pub mod objects; mod parse_mode; pub mod response; @@ -35,7 +36,5 @@ mod trait_async; #[cfg(feature = "telegram-trait")] mod trait_sync; -mod macros; - /// Default Bot API URL pub const BASE_API_URL: &str = "https://api.telegram.org/bot"; diff --git a/src/macros.rs b/src/macros.rs index a8c48e6..d4ed515 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -1,3 +1,5 @@ +pub use macro_rules_attribute::apply; + macro_rules_attribute::attribute_alias! { // Enable [`bon::builder`] `into` for specific types to reduce boilerplate for the callers. #[apply(apistruct!)] = diff --git a/src/objects.rs b/src/objects.rs index cb947c1..107222f 100644 --- a/src/objects.rs +++ b/src/objects.rs @@ -2,11 +2,10 @@ #![allow(deprecated)] -use macro_rules_attribute::apply; use serde::{Deserialize, Serialize}; use crate::api_params::FileUpload; -use crate::macros::apistruct; +use crate::macros::{apistruct, apply}; use crate::ParseMode; #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]