Skip to content

Commit 464d3ae

Browse files
tottotoseanmonstar
authored andcommitted
refactor(lib): replace deprecated numeric api with primitive one
1 parent a8f9e06 commit 464d3ae

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

src/body/length.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ impl From<Option<u64>> for DecodedLength {
1515
}
1616

1717
#[cfg(any(feature = "http1", feature = "http2", test))]
18-
const MAX_LEN: u64 = std::u64::MAX - 2;
18+
const MAX_LEN: u64 = u64::MAX - 2;
1919

2020
impl DecodedLength {
21-
pub(crate) const CLOSE_DELIMITED: DecodedLength = DecodedLength(::std::u64::MAX);
22-
pub(crate) const CHUNKED: DecodedLength = DecodedLength(::std::u64::MAX - 1);
21+
pub(crate) const CLOSE_DELIMITED: DecodedLength = DecodedLength(u64::MAX);
22+
pub(crate) const CHUNKED: DecodedLength = DecodedLength(u64::MAX - 1);
2323
pub(crate) const ZERO: DecodedLength = DecodedLength(0);
2424

2525
#[cfg(test)]

src/client/conn/http2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ where
406406
///
407407
/// The value must be no larger than `u32::MAX`.
408408
pub fn max_send_buf_size(&mut self, max: usize) -> &mut Self {
409-
assert!(max <= std::u32::MAX as usize);
409+
assert!(max <= u32::MAX as usize);
410410
self.h2_builder.max_send_buffer_size = max;
411411
self
412412
}

src/proto/h1/decode.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use std::error::Error as StdError;
22
use std::fmt;
33
use std::io;
44
use std::task::{Context, Poll};
5-
use std::usize;
65

76
use bytes::{BufMut, Bytes, BytesMut};
87
use futures_util::ready;

src/server/conn/http2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ impl<E> Builder<E> {
247247
///
248248
/// The value must be no larger than `u32::MAX`.
249249
pub fn max_send_buf_size(&mut self, max: usize) -> &mut Self {
250-
assert!(max <= std::u32::MAX as usize);
250+
assert!(max <= u32::MAX as usize);
251251
self.h2_builder.max_send_buffer_size = max;
252252
self
253253
}

0 commit comments

Comments
 (0)