From 7e8eb0c57d60ef07c8ffb70954555cec8db85422 Mon Sep 17 00:00:00 2001 From: John Smith Date: Fri, 10 Dec 2021 20:16:21 -0500 Subject: [PATCH] clippy fix --- veilid-server/src/unix.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/veilid-server/src/unix.rs b/veilid-server/src/unix.rs index d2edf933..c23a93dd 100644 --- a/veilid-server/src/unix.rs +++ b/veilid-server/src/unix.rs @@ -299,8 +299,8 @@ pub async fn main() -> Result<(), String> { }); // Handle log messages on main thread for capnproto rpc let capi2 = capi.clone(); - let capi_jh2 = if let Some(client_log_channel) = client_log_channel { - Some(async_std::task::spawn_local(async move { + let capi_jh2 = client_log_channel.map(|client_log_channel| { + async_std::task::spawn_local(async move { trace!("client logging started"); while let Ok(message) = client_log_channel.recv().await { if let Some(c) = capi2.borrow().as_ref().cloned() { @@ -308,10 +308,8 @@ pub async fn main() -> Result<(), String> { } } trace!("client logging stopped") - })) - } else { - None - }; + }) + }); // Auto-attach if desired if auto_attach {