Skip to content
This repository was archived by the owner on Jun 4, 2023. It is now read-only.

Commit 8fd8794

Browse files
authored
Merge pull request containerd#155 from Tim-Zhang/fix-clippy-warning-in-rust-1.63
clippy: fix warnings in rust 1.63
2 parents 0145f97 + 4f1e5f1 commit 8fd8794

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/asynchronous/stream.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,11 @@ where
309309
}
310310

311311
async fn _recv(rx: &mut ResultReceiver) -> Result<GenMessage> {
312-
rx.recv()
313-
.await
314-
.unwrap_or_else(|| Err(Error::Others("Receive packet from recver error".to_string())))
312+
rx.recv().await.unwrap_or_else(|| {
313+
Err(Error::Others(
314+
"Receive packet from recver error".to_string(),
315+
))
316+
})
315317
}
316318

317319
async fn _send(tx: &MessageSender, msg: GenMessage) -> Result<()> {
@@ -320,7 +322,7 @@ async fn _send(tx: &MessageSender, msg: GenMessage) -> Result<()> {
320322
.map_err(|e| Error::Others(format!("Send data packet to sender error {:?}", e)))
321323
}
322324

323-
#[derive(Clone, Copy, Debug, PartialEq)]
325+
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
324326
pub enum Kind {
325327
Client,
326328
Server,

src/proto.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub const FLAG_REMOTE_OPEN: u8 = 0x2;
2828
pub const FLAG_NO_DATA: u8 = 0x4;
2929

3030
/// Message header of ttrpc.
31-
#[derive(Default, Debug, Clone, Copy, PartialEq)]
31+
#[derive(Default, Debug, Clone, Copy, PartialEq, Eq)]
3232
pub struct MessageHeader {
3333
pub length: u32,
3434
pub stream_id: u32,
@@ -150,7 +150,7 @@ impl MessageHeader {
150150
}
151151

152152
/// Generic message of ttrpc.
153-
#[derive(Default, Debug, Clone, PartialEq)]
153+
#[derive(Default, Debug, Clone, PartialEq, Eq)]
154154
pub struct GenMessage {
155155
pub header: MessageHeader,
156156
pub payload: Vec<u8>,
@@ -236,7 +236,7 @@ impl<M: protobuf::Message> Codec for M {
236236
}
237237

238238
/// Message of ttrpc.
239-
#[derive(Default, Debug, Clone, PartialEq)]
239+
#[derive(Default, Debug, Clone, PartialEq, Eq)]
240240
pub struct Message<C> {
241241
pub header: MessageHeader,
242242
pub payload: C,

0 commit comments

Comments
 (0)