Repository: bytebeamio/rumqtt (language: rust)

Issue:
RecvError, TryRecvError and RecvTimeoutErrors are not reachable
I wanted to include the graciously added code from https://github.com/bytebeamio/rumqtt/pull/458/files, however I realized that I cannot match on the above errors, since they are public in a private submodule (client) and are not reexported at the top level. Could a top level reexport please be added?


Discussion / hints:

Fix patch:
diff --git a/rumqttc/src/client.rs b/rumqttc/src/client.rs
index 3f198caac..8a88592ae 100644
--- a/rumqttc/src/client.rs
+++ b/rumqttc/src/client.rs
@@ -399,7 +399,7 @@ impl Connection {
 
     /// Attempt to fetch an incoming [`Event`] on the [`EvenLoop`], returning an error
     /// if all clients/users have closed requests channel.
-    /// 
+    ///
     /// [`EvenLoop`]: super::EventLoop
     pub fn recv(&mut self) -> Result<Result<Event, ConnectionError>, RecvError> {
         let f = self.eventloop.poll();
@@ -410,7 +410,7 @@ impl Connection {
 
     /// Attempt to fetch an incoming [`Event`] on the [`EvenLoop`], returning an error
     /// if none immediately present or all clients/users have closed requests channel.
-    /// 
+    ///
     /// [`EvenLoop`]: super::EventLoop
     pub fn try_recv(&mut self) -> Result<Result<Event, ConnectionError>, TryRecvError> {
         let f = self.eventloop.poll();
@@ -421,7 +421,7 @@ impl Connection {
 
     /// Attempt to fetch an incoming [`Event`] on the [`EvenLoop`], returning an error
     /// if all clients/users have closed requests channel or the timeout has expired.
-    /// 
+    ///
     /// [`EvenLoop`]: super::EventLoop
     pub fn recv_timeout(
         &mut self,
diff --git a/rumqttc/src/lib.rs b/rumqttc/src/lib.rs
index 3a5ecefcc..8f47d3c71 100644
--- a/rumqttc/src/lib.rs
+++ b/rumqttc/src/lib.rs
@@ -112,7 +112,9 @@ mod state;
 mod tls;
 pub mod v5;
 
-pub use client::{AsyncClient, Client, ClientError, Connection, Iter};
+pub use client::{
+    AsyncClient, Client, ClientError, Connection, Iter, RecvError, RecvTimeoutError, TryRecvError,
+};
 pub use eventloop::{ConnectionError, Event, EventLoop};
 pub use mqttbytes::v4::*;
 pub use mqttbytes::*;
diff --git a/rumqttd/src/link/console.rs b/rumqttd/src/link/console.rs
index 500179e4b..f76dc2dd1 100644
--- a/rumqttd/src/link/console.rs
+++ b/rumqttd/src/link/console.rs
@@ -15,8 +15,7 @@ impl ConsoleLink {
     /// Requires the corresponding Router to be running to complete
     pub fn new(config: ConsoleSettings, router_tx: Sender<(ConnectionId, Event)>) -> ConsoleLink {
         let tx = router_tx.clone();
-        let (link_tx, link_rx, _ack) =
-            Link::new(None, "console", tx, true, None, true).unwrap();
+        let (link_tx, link_rx, _ack) = Link::new(None, "console", tx, true, None, true).unwrap();
         let connection_id = link_tx.connection_id;
         ConsoleLink {
             config,
diff --git a/rumqttd/src/router/scheduler.rs b/rumqttd/src/router/scheduler.rs
index 2ac9f9dae..a91eb7eb3 100644
--- a/rumqttd/src/router/scheduler.rs
+++ b/rumqttd/src/router/scheduler.rs
@@ -25,7 +25,6 @@ impl Scheduler {
     }
 
     pub fn add(&mut self, tracker: Tracker) -> ConnectionId {
-        
         self.trackers.insert(tracker)
     }
 


Test patch: