diff --git a/CHANGELOG.md b/CHANGELOG.md index d34b2fb2..9491dffc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/dispatching/dialogue/storage/mod.rs b/src/dispatching/dialogue/storage/mod.rs index a7cd5a32..3430de5e 100644 --- a/src/dispatching/dialogue/storage/mod.rs +++ b/src/dispatching/dialogue/storage/mod.rs @@ -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,