Skip to content

Commit

Permalink
chore: address clippy lints for Rust 1.85.0-beta
Browse files Browse the repository at this point in the history
Pull-Request: #5802.
  • Loading branch information
elenaf9 authored Jan 9, 2025
1 parent 4a1122e commit 63c0731
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
12 changes: 6 additions & 6 deletions muxers/mplex/src/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,43 +299,43 @@ impl Encoder for Codec {
role: Endpoint::Listener,
},
data,
} => (num << 3 | 1, data),
} => ((num << 3) | 1, data),
Frame::Data {
stream_id:
LocalStreamId {
num,
role: Endpoint::Dialer,
},
data,
} => (num << 3 | 2, data),
} => ((num << 3) | 2, data),
Frame::Close {
stream_id:
LocalStreamId {
num,
role: Endpoint::Listener,
},
} => (num << 3 | 3, Bytes::new()),
} => ((num << 3) | 3, Bytes::new()),
Frame::Close {
stream_id:
LocalStreamId {
num,
role: Endpoint::Dialer,
},
} => (num << 3 | 4, Bytes::new()),
} => ((num << 3) | 4, Bytes::new()),
Frame::Reset {
stream_id:
LocalStreamId {
num,
role: Endpoint::Listener,
},
} => (num << 3 | 5, Bytes::new()),
} => ((num << 3) | 5, Bytes::new()),
Frame::Reset {
stream_id:
LocalStreamId {
num,
role: Endpoint::Dialer,
},
} => (num << 3 | 6, Bytes::new()),
} => ((num << 3) | 6, Bytes::new()),
};

let mut header_buf = encode::u64_buffer();
Expand Down
4 changes: 2 additions & 2 deletions protocols/kad/src/kbucket/bucket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ where
// The bucket is full with connected nodes. Drop the pending node.
return None;
}
debug_assert!(self.first_connected_pos.map_or(true, |p| p > 0)); // (*)
// The pending node will be inserted.
debug_assert!(self.first_connected_pos.is_none_or(|p| p > 0)); // (*)
// The pending node will be inserted.
let inserted = pending.node.clone();
// A connected pending node goes at the end of the list for
// the connected peers, removing the least-recently connected.
Expand Down
1 change: 0 additions & 1 deletion protocols/kad/src/query/peers/closest/disjoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,6 @@ mod tests {
.flatten()
.collect::<HashSet<_>>()
.into_iter()
.map(Key::from)
.collect::<Vec<_>>();

deduplicated.sort_unstable_by(|a, b| {
Expand Down

0 comments on commit 63c0731

Please sign in to comment.