From 62bf55c8e6ff1e6b45b20d8dfdf70cbf0e5ee9b8 Mon Sep 17 00:00:00 2001 From: Temirkhan Myrzamadi Date: Fri, 31 Jul 2020 00:56:39 +0600 Subject: [PATCH] Don't export REPLs to teloxide::dispatching --- src/dispatching/mod.rs | 5 +---- src/dispatching/{ => repls}/commands_repl.rs | 2 +- src/dispatching/repls/mod.rs | 5 +++++ src/dispatching/{ => repls}/repl.rs | 2 +- src/lib.rs | 4 +++- 5 files changed, 11 insertions(+), 7 deletions(-) rename src/dispatching/{ => repls}/commands_repl.rs (97%) create mode 100644 src/dispatching/repls/mod.rs rename src/dispatching/{ => repls}/repl.rs (98%) diff --git a/src/dispatching/mod.rs b/src/dispatching/mod.rs index 685ef6a6..05e367dd 100644 --- a/src/dispatching/mod.rs +++ b/src/dispatching/mod.rs @@ -43,20 +43,17 @@ //! [`tokio::sync::mpsc::UnboundedReceiver`]: https://docs.rs/tokio/0.2.11/tokio/sync/mpsc/struct.UnboundedReceiver.html //! [examples/dialogue_bot]: https://github.com/teloxide/teloxide/tree/master/examples/dialogue_bot -mod commands_repl; pub mod dialogue; mod dispatcher; mod dispatcher_handler; mod dispatcher_handler_rx_ext; -mod repl; +pub(crate) mod repls; pub mod update_listeners; mod update_with_cx; -pub use commands_repl::{commands_repl, commands_repl_with_listener}; pub use dispatcher::Dispatcher; pub use dispatcher_handler::DispatcherHandler; pub use dispatcher_handler_rx_ext::DispatcherHandlerRxExt; -pub use repl::{repl, repl_with_listener}; use tokio::sync::mpsc::UnboundedReceiver; pub use update_with_cx::UpdateWithCx; diff --git a/src/dispatching/commands_repl.rs b/src/dispatching/repls/commands_repl.rs similarity index 97% rename from src/dispatching/commands_repl.rs rename to src/dispatching/repls/commands_repl.rs index 09323799..c842fd7a 100644 --- a/src/dispatching/commands_repl.rs +++ b/src/dispatching/repls/commands_repl.rs @@ -51,7 +51,7 @@ where /// bot. /// /// [`Dispatcher`]: crate::dispatching::Dispatcher -/// [`commands_repl`]: crate::dispatching::commands_repl() +/// [`commands_repl`]: crate::dispatching::repls::commands_repl() /// [`UpdateListener`]: crate::dispatching::update_listeners::UpdateListener pub async fn commands_repl_with_listener<'a, Cmd, H, Fut, L, ListenerE, HandlerE>( bot: Bot, diff --git a/src/dispatching/repls/mod.rs b/src/dispatching/repls/mod.rs new file mode 100644 index 00000000..29f782f7 --- /dev/null +++ b/src/dispatching/repls/mod.rs @@ -0,0 +1,5 @@ +mod commands_repl; +mod repl; + +pub use commands_repl::{commands_repl, commands_repl_with_listener}; +pub use repl::{repl, repl_with_listener}; diff --git a/src/dispatching/repl.rs b/src/dispatching/repls/repl.rs similarity index 98% rename from src/dispatching/repl.rs rename to src/dispatching/repls/repl.rs index 49673857..9a50355f 100644 --- a/src/dispatching/repl.rs +++ b/src/dispatching/repls/repl.rs @@ -42,7 +42,7 @@ where /// bot. /// /// [`Dispatcher`]: crate::dispatching::Dispatcher -/// [`repl`]: crate::dispatching::repl() +/// [`repl`]: crate::dispatching::repls::repl() /// [`UpdateListener`]: crate::dispatching::update_listeners::UpdateListener pub async fn repl_with_listener<'a, H, Fut, E, L, ListenerE>(bot: Bot, handler: H, listener: L) where diff --git a/src/lib.rs b/src/lib.rs index 2e2afb27..c3ae1ef4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -42,7 +42,9 @@ #![forbid(unsafe_code)] pub use bot::{Bot, BotBuilder}; -pub use dispatching::{commands_repl, commands_repl_with_listener, repl, repl_with_listener}; +pub use dispatching::repls::{ + commands_repl, commands_repl_with_listener, repl, repl_with_listener, +}; pub use errors::{ApiErrorKind, DownloadError, KnownApiErrorKind, RequestError}; mod errors;