Skip to content

Commit 2967fbb

Browse files
authored
chore: replace legacy numeric constant with corresponding one (#789)
1 parent e407f2e commit 2967fbb

File tree

6 files changed

+3
-9
lines changed

6 files changed

+3
-9
lines changed

src/client.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ use std::future::Future;
148148
use std::pin::Pin;
149149
use std::task::{Context, Poll};
150150
use std::time::Duration;
151-
use std::usize;
152151
use tokio::io::{AsyncRead, AsyncWrite, AsyncWriteExt};
153152
use tracing::Instrument;
154153

@@ -1070,7 +1069,7 @@ impl Builder {
10701069
///
10711070
/// This function panics if `max` is larger than `u32::MAX`.
10721071
pub fn max_send_buffer_size(&mut self, max: usize) -> &mut Self {
1073-
assert!(max <= std::u32::MAX as usize);
1072+
assert!(max <= u32::MAX as usize);
10741073
self.max_send_buffer_size = max;
10751074
self
10761075
}

src/frame/stream_id.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use std::u32;
2-
31
/// A stream identifier, as described in [Section 5.1.1] of RFC 7540.
42
///
53
/// Streams are identified with an unsigned 31-bit integer. Streams

src/hpack/table.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use http::method::Method;
66

77
use std::collections::VecDeque;
88
use std::hash::{Hash, Hasher};
9-
use std::{cmp, mem, usize};
9+
use std::{cmp, mem};
1010

1111
/// HPACK encoder table
1212
#[derive(Debug)]

src/proto/streams/counts.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
use super::*;
22

3-
use std::usize;
4-
53
#[derive(Debug)]
64
pub(super) struct Counts {
75
/// Acting as a client or server. This allows us to track which values to

src/proto/streams/stream.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use super::*;
22

33
use std::task::{Context, Waker};
44
use std::time::Instant;
5-
use std::usize;
65

76
/// Tracks Stream related state
87
///

src/server.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ impl Builder {
963963
///
964964
/// This function panics if `max` is larger than `u32::MAX`.
965965
pub fn max_send_buffer_size(&mut self, max: usize) -> &mut Self {
966-
assert!(max <= std::u32::MAX as usize);
966+
assert!(max <= u32::MAX as usize);
967967
self.max_send_buffer_size = max;
968968
self
969969
}

0 commit comments

Comments
 (0)