Repository: bytebeamio/rumqtt (language: rust)

Issue:
Rework `ClientError` to not expose flume constructs
`ClientError` should not contain flume errors


Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1f727cdf1..41cdc9e25 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,10 @@
+----------------
+rumqttc
+-----------
+- Change variants in `ClientError` to not expose dependence on flume/`SendError`.
+
+-----------
+
 ### R13
 ----------------
 rumqttc v0.13.0
diff --git a/rumqttc/src/client.rs b/rumqttc/src/client.rs
index ef457f648..348deef4e 100644
--- a/rumqttc/src/client.rs
+++ b/rumqttc/src/client.rs
@@ -13,15 +13,33 @@ use tokio::runtime::Runtime;
 #[derive(Debug, thiserror::Error)]
 pub enum ClientError {
     #[error("Failed to send cancel request to eventloop")]
-    Cancel(#[from] SendError<()>),
+    Cancel,
     #[error("Failed to send mqtt requests to eventloop")]
-    Request(#[from] SendError<Request>),
+    Request(Request),
     #[error("Failed to send mqtt requests to eventloop")]
-    TryRequest(#[from] TrySendError<Request>),
+    TryRequest(Request),
     #[error("Serialization error: {0}")]
     Mqtt4(#[from] mqttbytes::Error),
 }
 
+impl From<SendError<()>> for ClientError {
+    fn from(_: SendError<()>) -> Self {
+        Self::Cancel
+    }
+}
+
+impl From<SendError<Request>> for ClientError {
+    fn from(e: SendError<Request>) -> Self {
+        Self::Request(e.into_inner())
+    }
+}
+
+impl From<TrySendError<Request>> for ClientError {
+    fn from(e: TrySendError<Request>) -> Self {
+        Self::TryRequest(e.into_inner())
+    }
+}
+
 /// `AsyncClient` to communicate with MQTT `Eventloop`
 /// This is cloneable and can be used to asynchronously Publish, Subscribe.
 #[derive(Clone, Debug)]


Test patch: