Skip to content

Commit

Permalink
refactor: flatten module structure
Browse files Browse the repository at this point in the history
They are exported on top level anyway, so there is no real need for the folders
  • Loading branch information
EdJoPaTo committed Sep 10, 2024
1 parent 4d82cc5 commit 8eaef6f
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 30 deletions.
9 changes: 0 additions & 9 deletions src/api.rs

This file was deleted.

9 changes: 0 additions & 9 deletions src/api_traits.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::api_traits::AsyncTelegramApi;
use crate::error::Error;
use crate::trait_async::AsyncTelegramApi;
use async_trait::async_trait;
use reqwest::multipart;
use serde_json::Value;
Expand Down
2 changes: 1 addition & 1 deletion src/api/telegram_api_impl.rs → src/client_ureq.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::api_traits::TelegramApi;
use crate::error::Error;
use crate::trait_sync::TelegramApi;
use multipart::client::lazy::Multipart;
use serde_json::Value;
use std::path::PathBuf;
Expand Down
28 changes: 18 additions & 10 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
#[cfg(feature = "async-http-client")]
#[cfg(feature = "reqwest")]
pub use reqwest;
#[cfg(feature = "http-client")]
#[cfg(feature = "ureq")]
pub use ureq;

#[cfg(any(feature = "http-client", feature = "async-http-client"))]
mod api;
#[cfg(any(feature = "telegram-trait", feature = "async-telegram-trait"))]
mod api_traits;
#[cfg(feature = "async-http-client")]
mod client_reqwest;
#[cfg(feature = "http-client")]
mod client_ureq;
mod error;
pub mod objects;
pub mod parameters;
mod parse_mode;
pub mod response;
#[cfg(feature = "async-telegram-trait")]
mod trait_async;
#[cfg(feature = "telegram-trait")]
mod trait_sync;

#[cfg(any(feature = "http-client", feature = "async-http-client"))]
pub use api::*;
#[cfg(any(feature = "telegram-trait", feature = "async-telegram-trait"))]
pub use api_traits::*;
#[cfg(feature = "async-http-client")]
pub use client_reqwest::*;
#[cfg(feature = "http-client")]
pub use client_ureq::*;
pub use error::Error;
pub use parse_mode::ParseMode;
#[cfg(feature = "async-telegram-trait")]
pub use trait_async::AsyncTelegramApi;
#[cfg(feature = "telegram-trait")]
pub use trait_sync::TelegramApi;

/// Default Bot API URL
pub const BASE_API_URL: &str = "https://api.telegram.org/bot";
File renamed without changes.
File renamed without changes.

0 comments on commit 8eaef6f

Please sign in to comment.