Fix some of the clippy errors
This commit is contained in:
parent
e53650d02e
commit
8eec9c6759
6 changed files with 23 additions and 25 deletions
|
|
@ -24,15 +24,15 @@ where
|
|||
R: AsyncBufRead + Unpin + Send,
|
||||
{
|
||||
async fn peek_special_message(&mut self) -> Result<Option<SpecialMessage>, ProtoPeekError> {
|
||||
if let Some(cancel) = try_get_cancel_request(&mut self).await? {
|
||||
if let Some(cancel) = try_get_cancel_request(self).await? {
|
||||
return Ok(Some(cancel));
|
||||
}
|
||||
|
||||
if let Some(ssl) = try_get_ssl_request(&mut self).await? {
|
||||
if let Some(ssl) = try_get_ssl_request(self).await? {
|
||||
return Ok(Some(ssl));
|
||||
}
|
||||
|
||||
if let Some(startup) = try_get_startup_message(&mut self).await? {
|
||||
if let Some(startup) = try_get_startup_message(self).await? {
|
||||
return Ok(Some(startup));
|
||||
}
|
||||
|
||||
|
|
@ -43,11 +43,12 @@ where
|
|||
&mut self,
|
||||
msg: &SpecialMessage,
|
||||
) -> Result<(), ProtoConsumeError> {
|
||||
Ok(match msg {
|
||||
match msg {
|
||||
SpecialMessage::CancelRequest(_) => consume_cancel_request(self),
|
||||
SpecialMessage::SSLRequest => consume_ssl_request(self),
|
||||
SpecialMessage::StartupMessage(_) => consume_startup_message(self).await?,
|
||||
})
|
||||
};
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,12 +20,12 @@ where
|
|||
{
|
||||
async fn write_proto(&mut self, message: T) -> Result<(), ProtoWriteError> {
|
||||
let variant = message.variant();
|
||||
let mut data = message.serialize()?;
|
||||
let data = message.serialize()?;
|
||||
let length = data.len() as i32 + 4;
|
||||
|
||||
self.inner.write_u8(variant).await?;
|
||||
self.inner.write_i32(length).await?;
|
||||
self.inner.write_all(&mut data).await?;
|
||||
self.inner.write_all(&data).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue