Skip to content

Commit

Permalink
replace usize::max_value() with usize::MAX
Browse files Browse the repository at this point in the history
  • Loading branch information
magiclen committed Nov 2, 2022
1 parent 587b402 commit ba2bb10
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cidr-utils"
version = "0.5.8"
version = "0.5.9"
authors = ["Magic Len <len@magiclen.org>"]
edition = "2021"
repository = "https://github.com/magiclen/cidr-utils"
Expand Down
4 changes: 2 additions & 2 deletions src/utils/v4/ipv4_cidr_separator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl Ipv4CidrSeparator {

let bits = cidr.get_bits() + (n as f64).log2() as u8;

let usize_max_u64 = usize::max_value() as u64;
let usize_max_u64 = usize::MAX as u64;

if d <= usize_max_u64 {
for ip in iter.step_by(d as usize) {
Expand Down Expand Up @@ -113,7 +113,7 @@ impl Ipv4CidrSeparator {

let mut iter = cidr.iter();

let usize_max_u64 = usize::max_value() as u64;
let usize_max_u64 = usize::MAX as u64;

if d <= usize_max_u64 {
for ip in iter.step_by(d as usize) {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/v6/ipv6_cidr_separator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl Ipv6CidrSeparator {

let bits = cidr.get_bits() + log2_n as u8;

let usize_max_big_int = BigUint::from(usize::max_value());
let usize_max_big_int = BigUint::from(usize::MAX);

let d = size / n_big_int;

Expand Down Expand Up @@ -122,7 +122,7 @@ impl Ipv6CidrSeparator {

let mut iter = cidr.iter();

let usize_max_big_int = BigUint::from(usize::max_value());
let usize_max_big_int = BigUint::from(usize::MAX);

if d <= usize_max_big_int {
for ip in iter.step_by(d.to_usize().unwrap()) {
Expand Down

0 comments on commit ba2bb10

Please sign in to comment.