Merge pull request #363 from teloxide/must-use-storage

Mark all the functions of `Storage` as `#[must_use]`
This commit is contained in:
Waffle Lapkin 2021-04-03 11:31:18 +03:00 committed by GitHub
commit 2155e2b975
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 = "Futures are lazy and do nothing unless polled with .await"]
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 = "Futures are lazy and do nothing unless polled with .await"]
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 = "Futures are lazy and do nothing unless polled with .await"]
fn get_dialogue(
self: Arc<Self>,
chat_id: i64,