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 ## Changed
- The following functions were made `const`: - `CommandDescriptions::new` is made `const`
- `Dialogue::{new, chat_id}`
- `Polling::builder`
- `StatefulListener::new_with_hints`
- `CommandDescriptions::new`
- `respond`
- The following functions were made `#[must_use]`: - The following functions were made `#[must_use]`:
- `DispatcherBuilder::{enable_ctrlc_handler, distribution_function}` - `DispatcherBuilder::{enable_ctrlc_handler, distribution_function}`

View file

@ -141,13 +141,13 @@ where
/// Constructs a new dialogue with `storage` (where dialogues are stored) /// Constructs a new dialogue with `storage` (where dialogues are stored)
/// and `chat_id` of a current dialogue. /// and `chat_id` of a current dialogue.
#[must_use] #[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 } Self { storage, chat_id, _phantom: PhantomData }
} }
/// Returns a chat ID associated with this dialogue. /// Returns a chat ID associated with this dialogue.
#[must_use] #[must_use]
pub const fn chat_id(&self) -> ChatId { pub fn chat_id(&self) -> ChatId {
self.chat_id self.chat_id
} }

View file

@ -250,7 +250,7 @@ where
<R as Requester>::GetUpdates: Send, <R as Requester>::GetUpdates: Send,
{ {
/// Returns a builder for polling update listener. /// Returns a builder for polling update listener.
pub const fn builder(bot: R) -> PollingBuilder<R> { pub fn builder(bot: R) -> PollingBuilder<R> {
PollingBuilder { PollingBuilder {
bot, bot,
timeout: None, 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> { impl<St, Assf, Sf, Hauf, Thf> StatefulListener<St, Assf, Sf, Hauf, Thf> {
/// Creates a new stateful listener from its components. /// Creates a new stateful listener from its components.
pub const fn new_with_hints( pub fn new_with_hints(
state: St, state: St,
stream: Assf, stream: Assf,
stop_token: Sf, stop_token: Sf,