mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-14 11:44:04 +01:00
Fix a compilation error
This commit is contained in:
parent
9bd826ce3f
commit
a02e7f37d4
2 changed files with 17 additions and 2 deletions
|
@ -281,7 +281,7 @@ mod tests {
|
|||
let tx = tx.clone();
|
||||
|
||||
async move {
|
||||
if tx.send(update) {
|
||||
if tx.send(update).is_err() {
|
||||
panic!("tx.send(update) failed");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,12 +26,27 @@ where
|
|||
/// Something that can be handled by an error handler.
|
||||
///
|
||||
/// ## Examples
|
||||
/// ```
|
||||
/// use teloxide::error_handlers::OnError;
|
||||
///
|
||||
/// # #[tokio::main]
|
||||
/// # async fn main_() {
|
||||
/// // Prints nothing
|
||||
/// let ok: Result<i32, i32> = Ok(200);
|
||||
/// ok.log_on_error().await;
|
||||
///
|
||||
/// // Prints "Error: 404"
|
||||
/// let err: Result<i32, i32> = Err(404);
|
||||
/// err.log_on_error().await;
|
||||
/// # }
|
||||
/// ```
|
||||
///
|
||||
/// Use an arbitrary error handler:
|
||||
/// ```
|
||||
/// use teloxide::error_handlers::{IgnoringErrorHandler, OnError};
|
||||
///
|
||||
/// # #[tokio::main]
|
||||
/// # async fn main() {
|
||||
/// # async fn main_() {
|
||||
/// let err: Result<i32, i32> = Err(404);
|
||||
/// err.on_error(IgnoringErrorHandler::new()).await;
|
||||
/// # }
|
||||
|
|
Loading…
Add table
Reference in a new issue