From 4cd0c40be346c3f82ea84a6e0b202976cf7d403a Mon Sep 17 00:00:00 2001 From: Kyle Kelley Date: Thu, 12 Dec 2024 16:52:38 -0800 Subject: [PATCH] address clippy lints --- src/fair_queue.rs | 7 +++---- src/lib.rs | 8 +++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/fair_queue.rs b/src/fair_queue.rs index b1d2650..a2d7b88 100644 --- a/src/fair_queue.rs +++ b/src/fair_queue.rs @@ -24,10 +24,9 @@ impl QueueInner { priority: self.counter.fetch_add(1, atomic::Ordering::Relaxed), key: k, }); - match &self.waker { - Some(w) => w.wake_by_ref(), - None => (), - }; + if let Some(w) = &self.waker { + w.wake_by_ref(); + } } pub fn remove(&mut self, k: &K) { diff --git a/src/lib.rs b/src/lib.rs index 600fc77..8ae9643 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -185,8 +185,8 @@ impl SocketOptions { pub trait MultiPeerBackend: SocketBackend { /// This should not be public.. /// Find a better way of doing this - async fn peer_connected(self: Arc, peer_id: &PeerIdentity, io: FramedIo); + fn peer_disconnected(&self, peer_id: &PeerIdentity); } @@ -211,6 +211,8 @@ pub trait SocketSend { /// in [proxy] function as a capture parameter pub trait CaptureSocket: SocketSend {} + +#[allow(clippy::empty_line_after_outer_attr)] #[async_trait] pub trait Socket: Sized + Send { fn new() -> Self { @@ -333,11 +335,11 @@ pub trait Socket: Sized + Send { /// # Errors /// May give a `ZmqError::NoSuchConnection` if `endpoint` isn't connected. /// May also give any other zmq errors encountered when attempting to - /// disconnect. + /// disconnect // TODO: async fn disconnect(&mut self, endpoint: impl TryIntoEndpoint + 'async_trait) -> // ZmqResult<()>; - /// Disconnects all connecttions, blocking until finished. + /// Disconnects all connections, blocking until finished. // TODO: async fn disconnect_all(&mut self) -> ZmqResult<()>; /// Closes the socket, blocking until all associated binds are closed.