mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-08 19:33:53 +01:00
Merge pull request #581 from teloxide/dialogue-must-use
Mark `Dialogue::{new, chat_id}` as `#[must_use]`
This commit is contained in:
commit
3b01169751
2 changed files with 3 additions and 0 deletions
|
@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
- `UpdateListener::StopToken` is now always `Send` [**BC**].
|
||||
- Rename `BotCommand` trait to `BotCommands` [**BC**].
|
||||
- `BotCommands::descriptions` now returns `CommandDescriptions` instead of `String` [**BC**].
|
||||
- Mark `Dialogue::new` as `#[must_use]`.
|
||||
|
||||
## 0.7.2 - 2022-03-23
|
||||
|
||||
|
|
|
@ -120,11 +120,13 @@ where
|
|||
{
|
||||
/// Constructs a new dialogue with `storage` (where dialogues are stored)
|
||||
/// and `chat_id` of a current dialogue.
|
||||
#[must_use]
|
||||
pub fn new(storage: Arc<S>, chat_id: i64) -> Self {
|
||||
Self { storage, chat_id, _phantom: PhantomData }
|
||||
}
|
||||
|
||||
/// Returns a chat ID associated with this dialogue.
|
||||
#[must_use]
|
||||
pub fn chat_id(&self) -> i64 {
|
||||
self.chat_id
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue