From cde45ab8eee494a16cdff54620819b0288fe6dd1 Mon Sep 17 00:00:00 2001 From: Hirrolot Date: Fri, 9 Dec 2022 19:16:41 +0600 Subject: [PATCH] Remove useless `const` --- CHANGELOG.md | 7 +------ crates/teloxide/src/dispatching/dialogue.rs | 4 ++-- .../teloxide/src/dispatching/update_listeners/polling.rs | 2 +- .../src/dispatching/update_listeners/stateful_listener.rs | 2 +- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eef72e3c..11e2543c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,12 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Changed -- The following functions were made `const`: - - `Dialogue::{new, chat_id}` - - `Polling::builder` - - `StatefulListener::new_with_hints` - - `CommandDescriptions::new` - - `respond` +- `CommandDescriptions::new` is made `const` - The following functions were made `#[must_use]`: - `DispatcherBuilder::{enable_ctrlc_handler, distribution_function}` diff --git a/crates/teloxide/src/dispatching/dialogue.rs b/crates/teloxide/src/dispatching/dialogue.rs index 32386891..89d16326 100644 --- a/crates/teloxide/src/dispatching/dialogue.rs +++ b/crates/teloxide/src/dispatching/dialogue.rs @@ -141,13 +141,13 @@ where /// Constructs a new dialogue with `storage` (where dialogues are stored) /// and `chat_id` of a current dialogue. #[must_use] - pub const fn new(storage: Arc, chat_id: ChatId) -> Self { + pub fn new(storage: Arc, chat_id: ChatId) -> Self { Self { storage, chat_id, _phantom: PhantomData } } /// Returns a chat ID associated with this dialogue. #[must_use] - pub const fn chat_id(&self) -> ChatId { + pub fn chat_id(&self) -> ChatId { self.chat_id } diff --git a/crates/teloxide/src/dispatching/update_listeners/polling.rs b/crates/teloxide/src/dispatching/update_listeners/polling.rs index e212ee06..ffe8aa5a 100644 --- a/crates/teloxide/src/dispatching/update_listeners/polling.rs +++ b/crates/teloxide/src/dispatching/update_listeners/polling.rs @@ -250,7 +250,7 @@ where ::GetUpdates: Send, { /// Returns a builder for polling update listener. - pub const fn builder(bot: R) -> PollingBuilder { + pub fn builder(bot: R) -> PollingBuilder { PollingBuilder { bot, timeout: None, diff --git a/crates/teloxide/src/dispatching/update_listeners/stateful_listener.rs b/crates/teloxide/src/dispatching/update_listeners/stateful_listener.rs index 85140746..0eec921d 100644 --- a/crates/teloxide/src/dispatching/update_listeners/stateful_listener.rs +++ b/crates/teloxide/src/dispatching/update_listeners/stateful_listener.rs @@ -55,7 +55,7 @@ impl StatefulListener, Thfn> { impl StatefulListener { /// Creates a new stateful listener from its components. - pub const fn new_with_hints( + pub fn new_with_hints( state: St, stream: Assf, stop_token: Sf,