mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
Fix clippy::manual_inspect lints
This commit is contained in:
parent
76e2726803
commit
1ea69cf4dc
2 changed files with 3 additions and 12 deletions
|
@ -54,18 +54,12 @@ where
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
let tcp_listener = tokio::net::TcpListener::bind(address)
|
let tcp_listener = tokio::net::TcpListener::bind(address)
|
||||||
.await
|
.await
|
||||||
.map_err(|err| {
|
.inspect_err(|_| stop_token.stop())
|
||||||
stop_token.stop();
|
|
||||||
err
|
|
||||||
})
|
|
||||||
.expect("Couldn't bind to the address");
|
.expect("Couldn't bind to the address");
|
||||||
axum::serve(tcp_listener, app)
|
axum::serve(tcp_listener, app)
|
||||||
.with_graceful_shutdown(stop_flag)
|
.with_graceful_shutdown(stop_flag)
|
||||||
.await
|
.await
|
||||||
.map_err(|err| {
|
.inspect_err(|_| stop_token.stop())
|
||||||
stop_token.stop();
|
|
||||||
err
|
|
||||||
})
|
|
||||||
.expect("Axum server error");
|
.expect("Axum server error");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -122,10 +122,7 @@ impl DispatcherState {
|
||||||
.map(ShutdownState::from_u8)
|
.map(ShutdownState::from_u8)
|
||||||
.map_err(ShutdownState::from_u8)
|
.map_err(ShutdownState::from_u8)
|
||||||
// FIXME: `Result::inspect` when :(
|
// FIXME: `Result::inspect` when :(
|
||||||
.map(|st| {
|
.inspect(|_| self.notify.notify_waiters())
|
||||||
self.notify.notify_waiters();
|
|
||||||
st
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue