Mark all the functions of Storage as #[must_use]

This commit is contained in:
Temirkhan Myrzamadi 2021-04-03 06:53:02 +06:00
parent dfcf3d9d11
commit 617c861d26
2 changed files with 4 additions and 0 deletions

View file

@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Remove the `reqwest` dependency. It's not needed after the [teloxide-core] integration.
- A storage persistency bug ([issue 304](https://github.com/teloxide/teloxide/issues/304)).
- Log errors from `Storage::{remove_dialogue, update_dialogue}` in `DialogueDispatcher` ([issue 302](https://github.com/teloxide/teloxide/issues/302)).
- Mark all the functions of `Storage` as `#[must_use]`.
## [0.4.0] - 2021-03-22

View file

@ -43,6 +43,7 @@ pub trait Storage<D> {
type Error;
/// Removes a dialogue indexed by `chat_id`.
#[must_use]
fn remove_dialogue(
self: Arc<Self>,
chat_id: i64,
@ -51,6 +52,7 @@ pub trait Storage<D> {
D: Send + 'static;
/// Updates a dialogue indexed by `chat_id` with `dialogue`.
#[must_use]
fn update_dialogue(
self: Arc<Self>,
chat_id: i64,
@ -60,6 +62,7 @@ pub trait Storage<D> {
D: Send + 'static;
/// Provides a dialogue indexed by `chat_id`.
#[must_use]
fn get_dialogue(
self: Arc<Self>,
chat_id: i64,