diff --git a/rumqttc/src/client.rs b/rumqttc/src/client.rs index 2c96bd0d..e22645e5 100644 --- a/rumqttc/src/client.rs +++ b/rumqttc/src/client.rs @@ -182,9 +182,9 @@ impl AsyncClient { T: IntoIterator, { let subscribe = Subscribe::new_many(topics); - let is_err = subscribe.filters.iter().any(|t| !valid_filter(&t.path)); + let is_invalid_filter = subscribe.filters.iter().any(|t| !valid_filter(&t.path)); let request = Request::Subscribe(subscribe); - if is_err { + if is_invalid_filter { return Err(ClientError::Request(request)); } self.request_tx.send_async(request).await?; @@ -197,9 +197,9 @@ impl AsyncClient { T: IntoIterator, { let subscribe = Subscribe::new_many(topics); - let is_err = subscribe.filters.iter().any(|t| !valid_filter(&t.path)); + let is_invalid_filter = subscribe.filters.iter().any(|t| !valid_filter(&t.path)); let request = Request::Subscribe(subscribe); - if is_err { + if is_invalid_filter { return Err(ClientError::Request(request)); } self.request_tx.try_send(request)?; @@ -372,9 +372,9 @@ impl Client { T: IntoIterator, { let subscribe = Subscribe::new_many(topics); - let is_err = subscribe.filters.iter().any(|t| !valid_filter(&t.path)); + let is_invalid_filter = subscribe.filters.iter().any(|t| !valid_filter(&t.path)); let request = Request::Subscribe(subscribe); - if is_err { + if is_invalid_filter { return Err(ClientError::Request(request)); } self.client.request_tx.send(request)?; diff --git a/rumqttc/src/v5/client.rs b/rumqttc/src/v5/client.rs index 56def286..9c338a9d 100644 --- a/rumqttc/src/v5/client.rs +++ b/rumqttc/src/v5/client.rs @@ -323,9 +323,9 @@ impl AsyncClient { T: IntoIterator, { let subscribe = Subscribe::new_many(topics, properties); - let is_err = subscribe.filters.iter().any(|t| !valid_filter(&t.path)); + let is_invalid_filter = subscribe.filters.iter().any(|t| !valid_filter(&t.path)); let request = Request::Subscribe(subscribe); - if is_err { + if is_invalid_filter { return Err(ClientError::Request(request)); } self.request_tx.send_async(request).await?; @@ -360,9 +360,9 @@ impl AsyncClient { T: IntoIterator, { let subscribe = Subscribe::new_many(topics, properties); - let is_err = subscribe.filters.iter().any(|t| !valid_filter(&t.path)); + let is_invalid_filter = subscribe.filters.iter().any(|t| !valid_filter(&t.path)); let request = Request::Subscribe(subscribe); - if is_err { + if is_invalid_filter { return Err(ClientError::TryRequest(request)); } self.request_tx.try_send(request)?; @@ -665,9 +665,9 @@ impl Client { T: IntoIterator, { let subscribe = Subscribe::new_many(topics, properties); - let is_err = subscribe.filters.iter().any(|t| !valid_filter(&t.path)); + let is_invalid_filter = subscribe.filters.iter().any(|t| !valid_filter(&t.path)); let request = Request::Subscribe(subscribe); - if is_err { + if is_invalid_filter { return Err(ClientError::Request(request)); } self.client.request_tx.send(request)?; diff --git a/rumqttc/src/v5/state.rs b/rumqttc/src/v5/state.rs index 854aa7b0..5d415dc3 100644 --- a/rumqttc/src/v5/state.rs +++ b/rumqttc/src/v5/state.rs @@ -65,7 +65,7 @@ pub enum StateError { #[error("Connection failed with reason '{reason:?}' ")] ConnFail { reason: ConnectReturnCode }, #[error("Connection closed by peer abruptly")] - ConnectionAborted + ConnectionAborted, } impl From for StateError {