Mark Dialogue::{new, chat_id} as #[must_use]

This commit is contained in:
Hirrolot 2022-04-08 00:03:27 +06:00
parent 4530f935cb
commit f3b4769bc5
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**]. - `UpdateListener::StopToken` is now always `Send` [**BC**].
- Rename `BotCommand` trait to `BotCommands` [**BC**]. - Rename `BotCommand` trait to `BotCommands` [**BC**].
- `BotCommands::descriptions` now returns `CommandDescriptions` instead of `String` [**BC**]. - `BotCommands::descriptions` now returns `CommandDescriptions` instead of `String` [**BC**].
- Mark `Dialogue::new` as `#[must_use]`.
## 0.7.2 - 2022-03-23 ## 0.7.2 - 2022-03-23

View file

@ -120,11 +120,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]
pub fn new(storage: Arc<S>, chat_id: i64) -> Self { pub fn new(storage: Arc<S>, chat_id: i64) -> 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]
pub fn chat_id(&self) -> i64 { pub fn chat_id(&self) -> i64 {
self.chat_id self.chat_id
} }