Update CODE_STYLE.md

This commit is contained in:
Temirkhan Myrzamadi 2020-10-01 17:58:26 +06:00
parent e33bbeb027
commit e6ceee752f
5 changed files with 5 additions and 4 deletions

View file

@ -123,3 +123,4 @@ C: Into<String>, { ... }
## Misc
1. Use `Into<...>` only where there exists at least one conversion **and** it will be logically to use.
2. Always mark a function as `#[must_use]` if its return value **must** be used.
3. `Box::pin(async [move] { ... })` instead of `async [move] { ... }.boxed()`.

View file

@ -1,5 +1,5 @@
use crate::prelude::{DialogueStage, DialogueWithCx};
use futures::{future::BoxFuture, FutureExt};
use futures::future::BoxFuture;
use std::{future::Future, sync::Arc};
/// An asynchronous handler of an update used in [`DialogueDispatcher`].

View file

@ -1,5 +1,5 @@
use super::Storage;
use futures::{future::BoxFuture, FutureExt};
use futures::future::BoxFuture;
use std::{collections::HashMap, sync::Arc};
use tokio::sync::Mutex;

View file

@ -1,7 +1,7 @@
use std::future::Future;
use crate::dispatching::{DispatcherHandlerRx, UpdateWithCx};
use futures::{future::BoxFuture, FutureExt};
use futures::future::BoxFuture;
/// An asynchronous handler of a stream of updates used in [`Dispatcher`].
///

View file

@ -1,6 +1,6 @@
//! Convenient error handling.
use futures::{future::BoxFuture, FutureExt};
use futures::future::BoxFuture;
use std::{convert::Infallible, fmt::Debug, future::Future, sync::Arc};
/// An asynchronous handler of an error.