relax and de-clutter let_underscore_must_use
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
100c6f572b
commit
23a9055199
9 changed files with 5 additions and 29 deletions
|
@ -777,7 +777,6 @@ fn_to_numeric_cast_any = "warn"
|
||||||
format_push_string = "warn"
|
format_push_string = "warn"
|
||||||
get_unwrap = "warn"
|
get_unwrap = "warn"
|
||||||
impl_trait_in_params = "warn"
|
impl_trait_in_params = "warn"
|
||||||
let_underscore_must_use = "warn"
|
|
||||||
let_underscore_untyped = "warn"
|
let_underscore_untyped = "warn"
|
||||||
lossy_float_literal = "warn"
|
lossy_float_literal = "warn"
|
||||||
mem_forget = "warn"
|
mem_forget = "warn"
|
||||||
|
|
|
@ -28,7 +28,6 @@ mod_ctor! {}
|
||||||
mod_dtor! {}
|
mod_dtor! {}
|
||||||
|
|
||||||
/// Install the admin command handler
|
/// Install the admin command handler
|
||||||
#[allow(clippy::let_underscore_must_use)]
|
|
||||||
pub async fn init() {
|
pub async fn init() {
|
||||||
_ = services()
|
_ = services()
|
||||||
.admin
|
.admin
|
||||||
|
@ -45,7 +44,6 @@ pub async fn init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Uninstall the admin command handler
|
/// Uninstall the admin command handler
|
||||||
#[allow(clippy::let_underscore_must_use)]
|
|
||||||
pub async fn fini() {
|
pub async fn fini() {
|
||||||
_ = services().admin.handle.write().await.take();
|
_ = services().admin.handle.write().await.take();
|
||||||
_ = services()
|
_ = services()
|
||||||
|
|
|
@ -307,10 +307,7 @@ pub(crate) async fn sync_events_route(
|
||||||
duration = Duration::from_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(response)
|
Ok(response)
|
||||||
|
@ -1567,10 +1564,8 @@ pub(crate) async fn sync_events_v4_route(
|
||||||
if duration.as_secs() > 30 {
|
if duration.as_secs() > 30 {
|
||||||
duration = Duration::from_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 {
|
Ok(sync_events::v4::Response {
|
||||||
|
|
|
@ -71,7 +71,6 @@ fn handle_result(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::unnecessary_wraps)]
|
|
||||||
fn handle_result_403(
|
fn handle_result_403(
|
||||||
_method: &Method, _uri: &Uri, result: &axum::response::Response,
|
_method: &Method, _uri: &Uri, result: &axum::response::Response,
|
||||||
) -> Result<axum::response::Response, StatusCode> {
|
) -> Result<axum::response::Response, StatusCode> {
|
||||||
|
|
|
@ -17,7 +17,6 @@ use crate::{layers, serve};
|
||||||
|
|
||||||
/// Main loop base
|
/// Main loop base
|
||||||
#[tracing::instrument(skip_all)]
|
#[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> {
|
pub(crate) async fn run(server: Arc<Server>) -> Result<(), Error> {
|
||||||
let app = layers::build(&server)?;
|
let app = layers::build(&server)?;
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,6 @@ pub(super) async fn serve(server: &Arc<Server>, app: Router, mut shutdown: broad
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::let_underscore_must_use)]
|
|
||||||
async fn accept(
|
async fn accept(
|
||||||
server: &Arc<Server>, listener: &UnixListener, tasks: &mut JoinSet<()>, mut app: MakeService,
|
server: &Arc<Server>, listener: &UnixListener, tasks: &mut JoinSet<()>, mut app: MakeService,
|
||||||
builder: server::conn::auto::Builder<TokioExecutor>, conn: (UnixStream, SocketAddr),
|
builder: server::conn::auto::Builder<TokioExecutor>, conn: (UnixStream, SocketAddr),
|
||||||
|
|
|
@ -45,7 +45,6 @@ impl Console {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::let_underscore_must_use)]
|
|
||||||
pub async fn start(self: &Arc<Self>) {
|
pub async fn start(self: &Arc<Self>) {
|
||||||
let mut worker_join = self.worker_join.lock().expect("locked");
|
let mut worker_join = self.worker_join.lock().expect("locked");
|
||||||
if worker_join.is_none() {
|
if worker_join.is_none() {
|
||||||
|
@ -54,7 +53,6 @@ impl Console {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::let_underscore_must_use)]
|
|
||||||
pub async fn close(self: &Arc<Self>) {
|
pub async fn close(self: &Arc<Self>) {
|
||||||
self.interrupt();
|
self.interrupt();
|
||||||
let Some(worker_join) = self.worker_join.lock().expect("locked").take() else {
|
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();
|
self.worker_join.lock().expect("locked").take();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::let_underscore_must_use)]
|
|
||||||
async fn readline(self: &Arc<Self>) -> Result<ReadlineEvent, ReadlineError> {
|
async fn readline(self: &Arc<Self>) -> Result<ReadlineEvent, ReadlineError> {
|
||||||
let _suppression = log::Suppress::new(&services().server);
|
let _suppression = log::Suppress::new(&services().server);
|
||||||
|
|
||||||
|
@ -138,7 +135,6 @@ impl Console {
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::let_underscore_must_use)]
|
|
||||||
async fn handle(self: Arc<Self>, line: String) {
|
async fn handle(self: Arc<Self>, line: String) {
|
||||||
if line.trim().is_empty() {
|
if line.trim().is_empty() {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -37,7 +37,6 @@ conduit::mod_dtor! {}
|
||||||
|
|
||||||
static SERVICES: RwLock<Option<&Services>> = RwLock::new(None);
|
static SERVICES: RwLock<Option<&Services>> = RwLock::new(None);
|
||||||
|
|
||||||
#[allow(clippy::let_underscore_must_use)]
|
|
||||||
pub async fn init(server: &Arc<Server>) -> Result<()> {
|
pub async fn init(server: &Arc<Server>) -> Result<()> {
|
||||||
let d = Arc::new(Database::open(server).await?);
|
let d = Arc::new(Database::open(server).await?);
|
||||||
let s = Box::new(Services::build(server.clone(), d)?);
|
let s = Box::new(Services::build(server.clone(), d)?);
|
||||||
|
|
|
@ -132,11 +132,7 @@ impl Services {
|
||||||
|
|
||||||
if self.globals.allow_check_for_updates() {
|
if self.globals.allow_check_for_updates() {
|
||||||
let handle = globals::updates::start_check_for_updates_task();
|
let handle = globals::updates::start_check_for_updates_task();
|
||||||
|
_ = self.globals.updates_handle.lock().await.insert(handle);
|
||||||
#[allow(clippy::let_underscore_must_use)] // needed for shutdown
|
|
||||||
{
|
|
||||||
_ = self.globals.updates_handle.lock().await.insert(handle);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
debug_info!("Services startup complete.");
|
debug_info!("Services startup complete.");
|
||||||
|
@ -159,11 +155,7 @@ impl Services {
|
||||||
debug!("Waiting for update worker...");
|
debug!("Waiting for update worker...");
|
||||||
if let Some(updates_handle) = self.globals.updates_handle.lock().await.take() {
|
if let Some(updates_handle) = self.globals.updates_handle.lock().await.take() {
|
||||||
updates_handle.abort();
|
updates_handle.abort();
|
||||||
|
_ = updates_handle.await;
|
||||||
#[allow(clippy::let_underscore_must_use)]
|
|
||||||
{
|
|
||||||
_ = updates_handle.await;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (name, service) in &self.service {
|
for (name, service) in &self.service {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue