Skip to content

Commit

Permalink
refactor(rumqttc): use descriptive variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
arunanshub committed Apr 2, 2024
1 parent b4fe7f5 commit 1afd63e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions rumqttc/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ impl AsyncClient {
T: IntoIterator<Item = SubscribeFilter>,
{
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?;
Expand All @@ -197,9 +197,9 @@ impl AsyncClient {
T: IntoIterator<Item = SubscribeFilter>,
{
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)?;
Expand Down Expand Up @@ -372,9 +372,9 @@ impl Client {
T: IntoIterator<Item = SubscribeFilter>,
{
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)?;
Expand Down
12 changes: 6 additions & 6 deletions rumqttc/src/v5/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,9 @@ impl AsyncClient {
T: IntoIterator<Item = Filter>,
{
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?;
Expand Down Expand Up @@ -360,9 +360,9 @@ impl AsyncClient {
T: IntoIterator<Item = Filter>,
{
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)?;
Expand Down Expand Up @@ -665,9 +665,9 @@ impl Client {
T: IntoIterator<Item = Filter>,
{
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)?;
Expand Down
2 changes: 1 addition & 1 deletion rumqttc/src/v5/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<mqttbytes::Error> for StateError {
Expand Down

0 comments on commit 1afd63e

Please sign in to comment.