Merge pull request #581 from teloxide/dialogue-must-use

Mark `Dialogue::{new, chat_id}` as `#[must_use]`
This commit is contained in:
Hirrolot 2022-04-08 14:54:41 +06:00 committed by GitHub
commit 3b01169751
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View file

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

View file

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