Skip to content

Commit

Permalink
chore: replace legacy numeric constant with corresponding one (#789)
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto authored Jul 29, 2024
1 parent e407f2e commit 2967fbb
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ use std::future::Future;
use std::pin::Pin;
use std::task::{Context, Poll};
use std::time::Duration;
use std::usize;
use tokio::io::{AsyncRead, AsyncWrite, AsyncWriteExt};
use tracing::Instrument;

Expand Down Expand Up @@ -1070,7 +1069,7 @@ impl Builder {
///
/// This function panics if `max` is larger than `u32::MAX`.
pub fn max_send_buffer_size(&mut self, max: usize) -> &mut Self {
assert!(max <= std::u32::MAX as usize);
assert!(max <= u32::MAX as usize);
self.max_send_buffer_size = max;
self
}
Expand Down
2 changes: 0 additions & 2 deletions src/frame/stream_id.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::u32;

/// A stream identifier, as described in [Section 5.1.1] of RFC 7540.
///
/// Streams are identified with an unsigned 31-bit integer. Streams
Expand Down
2 changes: 1 addition & 1 deletion src/hpack/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use http::method::Method;

use std::collections::VecDeque;
use std::hash::{Hash, Hasher};
use std::{cmp, mem, usize};
use std::{cmp, mem};

/// HPACK encoder table
#[derive(Debug)]
Expand Down
2 changes: 0 additions & 2 deletions src/proto/streams/counts.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use super::*;

use std::usize;

#[derive(Debug)]
pub(super) struct Counts {
/// Acting as a client or server. This allows us to track which values to
Expand Down
1 change: 0 additions & 1 deletion src/proto/streams/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use super::*;

use std::task::{Context, Waker};
use std::time::Instant;
use std::usize;

/// Tracks Stream related state
///
Expand Down
2 changes: 1 addition & 1 deletion src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ impl Builder {
///
/// This function panics if `max` is larger than `u32::MAX`.
pub fn max_send_buffer_size(&mut self, max: usize) -> &mut Self {
assert!(max <= std::u32::MAX as usize);
assert!(max <= u32::MAX as usize);
self.max_send_buffer_size = max;
self
}
Expand Down

0 comments on commit 2967fbb

Please sign in to comment.