From 89a4672d36d771b6624573eb26276bcd82ef454c Mon Sep 17 00:00:00 2001 From: Ferdinand Schober Date: Tue, 10 Sep 2024 11:06:17 +0200 Subject: [PATCH] fix clippy --- src/capture.rs | 2 +- src/listen.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/capture.rs b/src/capture.rs index 01e249d..b350522 100644 --- a/src/capture.rs +++ b/src/capture.rs @@ -136,7 +136,7 @@ async fn do_capture( } thread_local! { - static PREV_LOG: Cell> = Cell::new(None); + static PREV_LOG: Cell> = const { Cell::new(None) }; } /// debounce a statement `$st`, i.e. the statement is executed only if the diff --git a/src/listen.rs b/src/listen.rs index 6a9afde..05a6112 100644 --- a/src/listen.rs +++ b/src/listen.rs @@ -119,7 +119,7 @@ async fn read_loop( ) -> Result<(), Error> { let mut b = [0u8; MAX_EVENT_SIZE]; - while let Ok(_) = conn.recv(&mut b).await { + while conn.recv(&mut b).await.is_ok() { match b.try_into() { Ok(event) => dtls_tx .send((event, conn.remote_addr().expect("no remote addr")))