Remove useless const

This commit is contained in:
Hirrolot 2022-12-09 19:16:41 +06:00
parent 762ab2f5e3
commit cde45ab8ee
4 changed files with 5 additions and 10 deletions

View file

@ -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}`

View file

@ -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<S>, chat_id: ChatId) -> Self {
pub fn new(storage: Arc<S>, 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
}

View file

@ -250,7 +250,7 @@ where
<R as Requester>::GetUpdates: Send,
{
/// Returns a builder for polling update listener.
pub const fn builder(bot: R) -> PollingBuilder<R> {
pub fn builder(bot: R) -> PollingBuilder<R> {
PollingBuilder {
bot,
timeout: None,

View file

@ -55,7 +55,7 @@ impl<St, Assf, Sf> StatefulListener<St, Assf, Sf, Haufn<St>, Thfn<St>> {
impl<St, Assf, Sf, Hauf, Thf> StatefulListener<St, Assf, Sf, Hauf, Thf> {
/// 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,