Skip to content

Commit 72a20ed

Browse files
committed
Update deprecated numeric constants
Problem Recent Rust toolchains deprecate the std::usize and std::u32 modules. The test suite fails to compile when CI promotes deprecation warnings to errors. Solution Use primitive associated constants directly and remove the deprecated std::usize module import. Validation Checked all h2-tests targets with warnings denied.
1 parent 27b730e commit 72a20ed

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

tests/h2-support/src/mock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::pin::Pin;
1414
use std::sync::{Arc, Mutex};
1515
use std::task::{Context, Poll, Waker};
1616
use std::time::Duration;
17-
use std::{cmp, io, usize};
17+
use std::{cmp, io};
1818

1919
/// A mock I/O
2020
#[derive(Debug)]

tests/h2-tests/tests/client_request.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ async fn request_stream_id_overflows() {
102102

103103
let h2 = async move {
104104
let (mut client, mut h2) = client::Builder::new()
105-
.initial_stream_id(::std::u32::MAX >> 1)
105+
.initial_stream_id(u32::MAX >> 1)
106106
.handshake::<_, Bytes>(io)
107107
.await
108108
.unwrap();
@@ -135,12 +135,12 @@ async fn request_stream_id_overflows() {
135135
let settings = srv.assert_client_handshake().await;
136136
assert_default_settings!(settings);
137137
srv.recv_frame(
138-
frames::headers(::std::u32::MAX >> 1)
138+
frames::headers(u32::MAX >> 1)
139139
.request("GET", "https://example.com/")
140140
.eos(),
141141
)
142142
.await;
143-
srv.send_frame(frames::headers(::std::u32::MAX >> 1).response(200).eos())
143+
srv.send_frame(frames::headers(u32::MAX >> 1).response(200).eos())
144144
.await;
145145
idle_ms(10).await;
146146
};

0 commit comments

Comments
 (0)