relax and de-clutter let_underscore_must_use

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-07-08 16:10:18 +00:00
parent 100c6f572b
commit 23a9055199
9 changed files with 5 additions and 29 deletions

View file

@ -777,7 +777,6 @@ fn_to_numeric_cast_any = "warn"
format_push_string = "warn"
get_unwrap = "warn"
impl_trait_in_params = "warn"
let_underscore_must_use = "warn"
let_underscore_untyped = "warn"
lossy_float_literal = "warn"
mem_forget = "warn"

View file

@ -28,7 +28,6 @@ mod_ctor! {}
mod_dtor! {}
/// Install the admin command handler
#[allow(clippy::let_underscore_must_use)]
pub async fn init() {
_ = services()
.admin
@ -45,7 +44,6 @@ pub async fn init() {
}
/// Uninstall the admin command handler
#[allow(clippy::let_underscore_must_use)]
pub async fn fini() {
_ = services().admin.handle.write().await.take();
_ = services()

View file

@ -307,10 +307,7 @@ pub(crate) async fn sync_events_route(
duration = Duration::from_secs(30);
}
#[allow(clippy::let_underscore_must_use)]
{
_ = tokio::time::timeout(duration, watcher).await;
}
_ = tokio::time::timeout(duration, watcher).await;
}
Ok(response)
@ -1567,10 +1564,8 @@ pub(crate) async fn sync_events_v4_route(
if duration.as_secs() > 30 {
duration = Duration::from_secs(30);
}
#[allow(clippy::let_underscore_must_use)]
{
_ = tokio::time::timeout(duration, watcher).await;
}
_ = tokio::time::timeout(duration, watcher).await;
}
Ok(sync_events::v4::Response {

View file

@ -71,7 +71,6 @@ fn handle_result(
}
}
#[allow(clippy::unnecessary_wraps)]
fn handle_result_403(
_method: &Method, _uri: &Uri, result: &axum::response::Response,
) -> Result<axum::response::Response, StatusCode> {

View file

@ -17,7 +17,6 @@ use crate::{layers, serve};
/// Main loop base
#[tracing::instrument(skip_all)]
#[allow(clippy::let_underscore_must_use)] // various of these are intended
pub(crate) async fn run(server: Arc<Server>) -> Result<(), Error> {
let app = layers::build(&server)?;

View file

@ -54,7 +54,6 @@ pub(super) async fn serve(server: &Arc<Server>, app: Router, mut shutdown: broad
Ok(())
}
#[allow(clippy::let_underscore_must_use)]
async fn accept(
server: &Arc<Server>, listener: &UnixListener, tasks: &mut JoinSet<()>, mut app: MakeService,
builder: server::conn::auto::Builder<TokioExecutor>, conn: (UnixStream, SocketAddr),

View file

@ -45,7 +45,6 @@ impl Console {
}
}
#[allow(clippy::let_underscore_must_use)]
pub async fn start(self: &Arc<Self>) {
let mut worker_join = self.worker_join.lock().expect("locked");
if worker_join.is_none() {
@ -54,7 +53,6 @@ impl Console {
}
}
#[allow(clippy::let_underscore_must_use)]
pub async fn close(self: &Arc<Self>) {
self.interrupt();
let Some(worker_join) = self.worker_join.lock().expect("locked").take() else {
@ -113,7 +111,6 @@ impl Console {
self.worker_join.lock().expect("locked").take();
}
#[allow(clippy::let_underscore_must_use)]
async fn readline(self: &Arc<Self>) -> Result<ReadlineEvent, ReadlineError> {
let _suppression = log::Suppress::new(&services().server);
@ -138,7 +135,6 @@ impl Console {
result
}
#[allow(clippy::let_underscore_must_use)]
async fn handle(self: Arc<Self>, line: String) {
if line.trim().is_empty() {
return;

View file

@ -37,7 +37,6 @@ conduit::mod_dtor! {}
static SERVICES: RwLock<Option<&Services>> = RwLock::new(None);
#[allow(clippy::let_underscore_must_use)]
pub async fn init(server: &Arc<Server>) -> Result<()> {
let d = Arc::new(Database::open(server).await?);
let s = Box::new(Services::build(server.clone(), d)?);

View file

@ -132,11 +132,7 @@ impl Services {
if self.globals.allow_check_for_updates() {
let handle = globals::updates::start_check_for_updates_task();
#[allow(clippy::let_underscore_must_use)] // needed for shutdown
{
_ = self.globals.updates_handle.lock().await.insert(handle);
}
_ = self.globals.updates_handle.lock().await.insert(handle);
}
debug_info!("Services startup complete.");
@ -159,11 +155,7 @@ impl Services {
debug!("Waiting for update worker...");
if let Some(updates_handle) = self.globals.updates_handle.lock().await.take() {
updates_handle.abort();
#[allow(clippy::let_underscore_must_use)]
{
_ = updates_handle.await;
}
_ = updates_handle.await;
}
for (name, service) in &self.service {