mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-03 09:49:07 +01:00
Update CODE_STYLE.md
This commit is contained in:
parent
e33bbeb027
commit
e6ceee752f
5 changed files with 5 additions and 4 deletions
|
@ -123,3 +123,4 @@ C: Into<String>, { ... }
|
||||||
## Misc
|
## Misc
|
||||||
1. Use `Into<...>` only where there exists at least one conversion **and** it will be logically to use.
|
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.
|
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()`.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use crate::prelude::{DialogueStage, DialogueWithCx};
|
use crate::prelude::{DialogueStage, DialogueWithCx};
|
||||||
use futures::{future::BoxFuture, FutureExt};
|
use futures::future::BoxFuture;
|
||||||
use std::{future::Future, sync::Arc};
|
use std::{future::Future, sync::Arc};
|
||||||
|
|
||||||
/// An asynchronous handler of an update used in [`DialogueDispatcher`].
|
/// An asynchronous handler of an update used in [`DialogueDispatcher`].
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use super::Storage;
|
use super::Storage;
|
||||||
use futures::{future::BoxFuture, FutureExt};
|
use futures::future::BoxFuture;
|
||||||
use std::{collections::HashMap, sync::Arc};
|
use std::{collections::HashMap, sync::Arc};
|
||||||
use tokio::sync::Mutex;
|
use tokio::sync::Mutex;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use std::future::Future;
|
use std::future::Future;
|
||||||
|
|
||||||
use crate::dispatching::{DispatcherHandlerRx, UpdateWithCx};
|
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`].
|
/// An asynchronous handler of a stream of updates used in [`Dispatcher`].
|
||||||
///
|
///
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
//! Convenient error handling.
|
//! Convenient error handling.
|
||||||
|
|
||||||
use futures::{future::BoxFuture, FutureExt};
|
use futures::future::BoxFuture;
|
||||||
use std::{convert::Infallible, fmt::Debug, future::Future, sync::Arc};
|
use std::{convert::Infallible, fmt::Debug, future::Future, sync::Arc};
|
||||||
|
|
||||||
/// An asynchronous handler of an error.
|
/// An asynchronous handler of an error.
|
||||||
|
|
Loading…
Reference in a new issue