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 { 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");
}); });

View file

@ -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
})
} }
} }