Skip to content

Commit 97ed76f

Browse files
committed
Merge branch 'main' into flub/merge-main-apr-8
2 parents deba4ee + 36d2b85 commit 97ed76f

File tree

5 files changed

+56
-55
lines changed

5 files changed

+56
-55
lines changed

Cargo.lock

Lines changed: 41 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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
@@ -418,7 +418,7 @@ impl Endpoint {
418418
fn new_cid(&mut self, ch: ConnectionHandle, path_id: PathId) -> ConnectionId {
419419
loop {
420420
let cid = self.local_cid_generator.generate_cid();
421-
if cid.len() == 0 {
421+
if cid.is_empty() {
422422
// Zero-length CID; nothing to track
423423
debug_assert_eq!(self.local_cid_generator.cid_len(), 0);
424424
return cid;
@@ -1016,7 +1016,7 @@ struct ConnectionIndex {
10161016
impl ConnectionIndex {
10171017
/// Associate an incoming connection with its initial destination CID
10181018
fn insert_initial_incoming(&mut self, dst_cid: ConnectionId, incoming_key: usize) {
1019-
if dst_cid.len() == 0 {
1019+
if dst_cid.is_empty() {
10201020
return;
10211021
}
10221022
self.connection_ids_initial
@@ -1025,7 +1025,7 @@ impl ConnectionIndex {
10251025

10261026
/// Remove an association with an initial destination CID
10271027
fn remove_initial(&mut self, dst_cid: ConnectionId) {
1028-
if dst_cid.len() == 0 {
1028+
if dst_cid.is_empty() {
10291029
return;
10301030
}
10311031
let removed = self.connection_ids_initial.remove(&dst_cid);
@@ -1034,7 +1034,7 @@ impl ConnectionIndex {
10341034

10351035
/// Associate a connection with its initial destination CID
10361036
fn insert_initial(&mut self, dst_cid: ConnectionId, connection: ConnectionHandle) {
1037-
if dst_cid.len() == 0 {
1037+
if dst_cid.is_empty() {
10381038
return;
10391039
}
10401040
self.connection_ids_initial
@@ -1090,7 +1090,7 @@ impl ConnectionIndex {
10901090

10911091
/// Find the existing connection that `datagram` should be routed to, if any
10921092
fn get(&self, addresses: &FourTuple, datagram: &PartialDecode) -> Option<RouteDatagramTo> {
1093-
if datagram.dst_cid().len() != 0 {
1093+
if !datagram.dst_cid().is_empty() {
10941094
if let Some(&(ch, path_id)) = self.connection_ids.get(datagram.dst_cid()) {
10951095
return Some(RouteDatagramTo::Connection(ch, path_id));
10961096
}
@@ -1100,7 +1100,7 @@ impl ConnectionIndex {
11001100
return Some(ch);
11011101
}
11021102
}
1103-
if datagram.dst_cid().len() == 0 {
1103+
if datagram.dst_cid().is_empty() {
11041104
if let Some(&ch) = self.incoming_connection_remotes.get(addresses) {
11051105
// Never multipath because QUIC-MULTIPATH 1.1 mandates the use of non-zero
11061106
// length CIDs. So this is always PathId(0).

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)