diff --git a/CHANGELOG.md b/CHANGELOG.md index 09047ed5..79890bdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [unreleased] +### Fixed + +- Compilation when the `ctrlc_handler` feature is disabled ([issue 462](https://github.com/teloxide/teloxide/issues/462)) + ## [0.5.2] - 2021-08-25 ### Fixed diff --git a/src/dispatching/mod.rs b/src/dispatching/mod.rs index 9936de96..98eec830 100644 --- a/src/dispatching/mod.rs +++ b/src/dispatching/mod.rs @@ -49,6 +49,7 @@ pub mod dialogue; pub mod stop_token; pub mod update_listeners; +#[cfg(feature = "ctrlc_handler")] pub(crate) mod repls; mod dispatcher; diff --git a/src/dispatching/repls/commands_repl.rs b/src/dispatching/repls/commands_repl.rs index a3625910..c1799d58 100644 --- a/src/dispatching/repls/commands_repl.rs +++ b/src/dispatching/repls/commands_repl.rs @@ -22,7 +22,6 @@ use tokio_stream::wrappers::UnboundedReceiverStream; /// /// [REPL]: https://en.wikipedia.org/wiki/Read-eval-print_loop /// [`Dispatcher`]: crate::dispatching::Dispatcher -#[cfg(feature = "ctrlc_handler")] pub async fn commands_repl(requester: R, bot_name: N, handler: H) where Cmd: BotCommand + Send + 'static, @@ -57,7 +56,6 @@ where /// [`Dispatcher`]: crate::dispatching::Dispatcher /// [`commands_repl`]: crate::dispatching::repls::commands_repl() /// [`UpdateListener`]: crate::dispatching::update_listeners::UpdateListener -#[cfg(feature = "ctrlc_handler")] pub async fn commands_repl_with_listener<'a, R, Cmd, H, Fut, L, ListenerE, HandlerE, N>( requester: R, bot_name: N, diff --git a/src/dispatching/repls/dialogues_repl.rs b/src/dispatching/repls/dialogues_repl.rs index 755d4dd3..345c6bcb 100644 --- a/src/dispatching/repls/dialogues_repl.rs +++ b/src/dispatching/repls/dialogues_repl.rs @@ -23,7 +23,6 @@ use teloxide_core::{requests::Requester, types::Message}; /// [REPL]: https://en.wikipedia.org/wiki/Read-eval-print_loop /// [`Dispatcher`]: crate::dispatching::Dispatcher /// [`InMemStorage`]: crate::dispatching::dialogue::InMemStorage -#[cfg(feature = "ctrlc_handler")] pub async fn dialogues_repl<'a, R, H, D, Fut>(requester: R, handler: H) where H: Fn(UpdateWithCx, D) -> Fut + Send + Sync + 'static, @@ -56,7 +55,6 @@ where /// [`dialogues_repl`]: crate::dispatching::repls::dialogues_repl() /// [`UpdateListener`]: crate::dispatching::update_listeners::UpdateListener /// [`InMemStorage`]: crate::dispatching::dialogue::InMemStorage -#[cfg(feature = "ctrlc_handler")] pub async fn dialogues_repl_with_listener<'a, R, H, D, Fut, L, ListenerE>( requester: R, handler: H, diff --git a/src/dispatching/repls/repl.rs b/src/dispatching/repls/repl.rs index a298e768..635a030c 100644 --- a/src/dispatching/repls/repl.rs +++ b/src/dispatching/repls/repl.rs @@ -21,7 +21,6 @@ use tokio_stream::wrappers::UnboundedReceiverStream; /// /// [REPL]: https://en.wikipedia.org/wiki/Read-eval-print_loop /// [`Dispatcher`]: crate::dispatching::Dispatcher -#[cfg(feature = "ctrlc_handler")] pub async fn repl(requester: R, handler: H) where H: Fn(UpdateWithCx) -> Fut + Send + Sync + 'static, @@ -52,7 +51,6 @@ where /// [`Dispatcher`]: crate::dispatching::Dispatcher /// [`repl`]: crate::dispatching::repls::repl() /// [`UpdateListener`]: crate::dispatching::update_listeners::UpdateListener -#[cfg(feature = "ctrlc_handler")] pub async fn repl_with_listener<'a, R, H, Fut, E, L, ListenerE>( requester: R, handler: H, diff --git a/src/lib.rs b/src/lib.rs index d09cda25..9114d239 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -60,6 +60,7 @@ // https://github.com/rust-lang/rust-clippy/issues/7422 #![allow(clippy::nonstandard_macro_braces)] +#[cfg(feature = "ctrlc_handler")] pub use dispatching::repls::{ commands_repl, commands_repl_with_listener, dialogues_repl, dialogues_repl_with_listener, repl, repl_with_listener,