Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Dec 30, 2024
1 parent ba70573 commit ff7d4b6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/v3/client/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,10 @@ where
{
/// Connect to mqtt server
pub async fn connect(&self) -> Result<Client, ClientError<codec::ConnectAck>> {
match timeout_checked(self.handshake_timeout, self._connect()).await {
Ok(res) => res.map_err(From::from),
Err(_) => Err(ClientError::HandshakeTimeout),
}
timeout_checked(self.handshake_timeout, self._connect())
.await
.map_err(|_| ClientError::HandshakeTimeout)
.and_then(|res| res)
}

async fn _connect(&self) -> Result<Client, ClientError<codec::ConnectAck>> {
Expand Down
8 changes: 4 additions & 4 deletions src/v5/client/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,10 @@ where
{
/// Connect to mqtt server
pub async fn connect(&self) -> Result<Client, ClientError<Box<codec::ConnectAck>>> {
match timeout_checked(self.handshake_timeout, self._connect()).await {
Ok(res) => res.map_err(From::from),
Err(_) => Err(ClientError::HandshakeTimeout),
}
timeout_checked(self.handshake_timeout, self._connect())
.await
.map_err(|_| ClientError::HandshakeTimeout)
.and_then(|res| res)
}

async fn _connect(&self) -> Result<Client, ClientError<Box<codec::ConnectAck>>> {
Expand Down
6 changes: 3 additions & 3 deletions src/v5/codec/packet/subscribe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,9 @@ impl Encode for SubscriptionOptions {
fn encode(&self, buf: &mut BytesMut) -> Result<(), EncodeError> {
buf.put_u8(
u8::from(self.qos)
| (self.no_local as u8) << 2
| (self.retain_as_published as u8) << 3
| u8::from(self.retain_handling) << 4,
| ((self.no_local as u8) << 2)
| ((self.retain_as_published as u8) << 3)
| (u8::from(self.retain_handling) << 4),
);
Ok(())
}
Expand Down

0 comments on commit ff7d4b6

Please sign in to comment.