Fix clippy::manual_inspect lints

This commit is contained in:
Andrey Brusnik 2024-08-24 18:28:11 +04:00
parent 76e2726803
commit 1ea69cf4dc
No known key found for this signature in database
GPG key ID: D33232F28CFF442C
2 changed files with 3 additions and 12 deletions

View file

@ -54,18 +54,12 @@ where
tokio::spawn(async move {
let tcp_listener = tokio::net::TcpListener::bind(address)
.await
.map_err(|err| {
stop_token.stop();
err
})
.inspect_err(|_| stop_token.stop())
.expect("Couldn't bind to the address");
axum::serve(tcp_listener, app)
.with_graceful_shutdown(stop_flag)
.await
.map_err(|err| {
stop_token.stop();
err
})
.inspect_err(|_| stop_token.stop())
.expect("Axum server error");
});

View file

@ -122,10 +122,7 @@ impl DispatcherState {
.map(ShutdownState::from_u8)
.map_err(ShutdownState::from_u8)
// FIXME: `Result::inspect` when :(
.map(|st| {
self.notify.notify_waiters();
st
})
.inspect(|_| self.notify.notify_waiters())
}
}