Skip to content

Commit

Permalink
chore: Fix clippy usage of a legacy numeric method (#1798)
Browse files Browse the repository at this point in the history
`u64::max_value()` -> `u64::MAX`
  • Loading branch information
larseggert authored Apr 8, 2024
1 parent 992d588 commit a65d945
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions neqo-crypto/src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,11 @@ mod test {

#[test]
// We allow replace_consts here because
// std::u64::max_value() isn't available
// std::u64::MAX isn't available
// in all of our targets
fn overflow_interval() {
init();
let interval = Interval::from(Duration::from_micros(u64::max_value()));
let interval = Interval::from(Duration::from_micros(u64::MAX));
let res: Res<PRTime> = interval.try_into();
assert!(res.is_err());
}
Expand Down
2 changes: 1 addition & 1 deletion neqo-qpack/src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ impl HeaderTable {
capacity: 0,
used: 0,
base: 0,
acked_inserts_cnt: if encoder { 0 } else { u64::max_value() },
acked_inserts_cnt: if encoder { 0 } else { u64::MAX },
}
}

Expand Down
2 changes: 1 addition & 1 deletion neqo-transport/src/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ impl CryptoDxAppData {
}

pub fn next(&self) -> Res<Self> {
if self.dx.epoch == usize::max_value() {
if self.dx.epoch == usize::MAX {
// Guard against too many key updates.
return Err(Error::KeysExhausted);
}
Expand Down
4 changes: 2 additions & 2 deletions neqo-transport/src/packet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ impl PacketBuilder {
}
Self {
encoder,
pn: u64::max_value(),
pn: u64::MAX,
header: header_start..header_start,
offsets: PacketBuilderOffsets {
first_byte_mask: PACKET_HP_MASK_SHORT,
Expand Down Expand Up @@ -201,7 +201,7 @@ impl PacketBuilder {

Self {
encoder,
pn: u64::max_value(),
pn: u64::MAX,
header: header_start..header_start,
offsets: PacketBuilderOffsets {
first_byte_mask: PACKET_HP_MASK_LONG,
Expand Down

0 comments on commit a65d945

Please sign in to comment.