Skip to content

Commit 36d2b85

Browse files
djcRalith
authored andcommitted
Apply suggestions from clippy 1.86
1 parent bc1125c commit 36d2b85

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

quinn-proto/src/connection/streams/send.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl Send {
3232

3333
/// Whether the stream has been reset
3434
pub(super) fn is_reset(&self) -> bool {
35-
matches!(self.state, SendState::ResetSent { .. })
35+
matches!(self.state, SendState::ResetSent)
3636
}
3737

3838
pub(super) fn finish(&mut self) -> Result<(), FinishError> {

quinn-proto/src/endpoint.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ impl Endpoint {
402402
fn new_cid(&mut self, ch: ConnectionHandle) -> ConnectionId {
403403
loop {
404404
let cid = self.local_cid_generator.generate_cid();
405-
if cid.len() == 0 {
405+
if cid.is_empty() {
406406
// Zero-length CID; nothing to track
407407
debug_assert_eq!(self.local_cid_generator.cid_len(), 0);
408408
return cid;
@@ -996,7 +996,7 @@ struct ConnectionIndex {
996996
impl ConnectionIndex {
997997
/// Associate an incoming connection with its initial destination CID
998998
fn insert_initial_incoming(&mut self, dst_cid: ConnectionId, incoming_key: usize) {
999-
if dst_cid.len() == 0 {
999+
if dst_cid.is_empty() {
10001000
return;
10011001
}
10021002
self.connection_ids_initial
@@ -1005,7 +1005,7 @@ impl ConnectionIndex {
10051005

10061006
/// Remove an association with an initial destination CID
10071007
fn remove_initial(&mut self, dst_cid: ConnectionId) {
1008-
if dst_cid.len() == 0 {
1008+
if dst_cid.is_empty() {
10091009
return;
10101010
}
10111011
let removed = self.connection_ids_initial.remove(&dst_cid);
@@ -1014,7 +1014,7 @@ impl ConnectionIndex {
10141014

10151015
/// Associate a connection with its initial destination CID
10161016
fn insert_initial(&mut self, dst_cid: ConnectionId, connection: ConnectionHandle) {
1017-
if dst_cid.len() == 0 {
1017+
if dst_cid.is_empty() {
10181018
return;
10191019
}
10201020
self.connection_ids_initial
@@ -1070,7 +1070,7 @@ impl ConnectionIndex {
10701070

10711071
/// Find the existing connection that `datagram` should be routed to, if any
10721072
fn get(&self, addresses: &FourTuple, datagram: &PartialDecode) -> Option<RouteDatagramTo> {
1073-
if datagram.dst_cid().len() != 0 {
1073+
if !datagram.dst_cid().is_empty() {
10741074
if let Some(&ch) = self.connection_ids.get(datagram.dst_cid()) {
10751075
return Some(RouteDatagramTo::Connection(ch));
10761076
}
@@ -1080,7 +1080,7 @@ impl ConnectionIndex {
10801080
return Some(ch);
10811081
}
10821082
}
1083-
if datagram.dst_cid().len() == 0 {
1083+
if datagram.dst_cid().is_empty() {
10841084
if let Some(&ch) = self.incoming_connection_remotes.get(addresses) {
10851085
return Some(RouteDatagramTo::Connection(ch));
10861086
}

quinn-proto/src/tests/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@ fn initial_retransmit() {
10771077
);
10781078
assert_matches!(
10791079
pair.client_conn_mut(client_ch).poll(),
1080-
Some(Event::Connected { .. })
1080+
Some(Event::Connected)
10811081
);
10821082
}
10831083

@@ -1245,7 +1245,7 @@ fn server_hs_retransmit() {
12451245
);
12461246
assert_matches!(
12471247
pair.client_conn_mut(client_ch).poll(),
1248-
Some(Event::Connected { .. })
1248+
Some(Event::Connected)
12491249
);
12501250
}
12511251

@@ -1984,15 +1984,15 @@ fn large_initial() {
19841984
);
19851985
assert_matches!(
19861986
pair.client_conn_mut(client_ch).poll(),
1987-
Some(Event::Connected { .. })
1987+
Some(Event::Connected)
19881988
);
19891989
assert_matches!(
19901990
pair.server_conn_mut(server_ch).poll(),
19911991
Some(Event::HandshakeDataReady)
19921992
);
19931993
assert_matches!(
19941994
pair.server_conn_mut(server_ch).poll(),
1995-
Some(Event::Connected { .. })
1995+
Some(Event::Connected)
19961996
);
19971997
}
19981998

@@ -2176,7 +2176,7 @@ fn handshake_anti_deadlock_probe() {
21762176
);
21772177
assert_matches!(
21782178
pair.client_conn_mut(client_ch).poll(),
2179-
Some(Event::Connected { .. })
2179+
Some(Event::Connected)
21802180
);
21812181
}
21822182

@@ -2206,7 +2206,7 @@ fn server_can_send_3_inital_packets() {
22062206
);
22072207
assert_matches!(
22082208
pair.client_conn_mut(client_ch).poll(),
2209-
Some(Event::Connected { .. })
2209+
Some(Event::Connected)
22102210
);
22112211
}
22122212

quinn-proto/src/tests/util.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,15 +225,15 @@ impl Pair {
225225
);
226226
assert_matches!(
227227
self.client_conn_mut(client_ch).poll(),
228-
Some(Event::Connected { .. })
228+
Some(Event::Connected)
229229
);
230230
assert_matches!(
231231
self.server_conn_mut(server_ch).poll(),
232232
Some(Event::HandshakeDataReady)
233233
);
234234
assert_matches!(
235235
self.server_conn_mut(server_ch).poll(),
236-
Some(Event::Connected { .. })
236+
Some(Event::Connected)
237237
);
238238
}
239239

0 commit comments

Comments
 (0)