Merge pull request #6482 from lcheylus/numeric_constants

shuf: use usize::MAX instead of std::usize::MAX
This commit is contained in:
Daniel Hofstetter 2024-06-19 14:54:16 +02:00 committed by GitHub
commit c9f4742f3b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -531,17 +531,17 @@ mod test_number_set_decision {
#[test]
fn test_stay_positive_large_remaining_first() {
assert_eq!(false, number_set_should_list_remaining(0, std::usize::MAX));
assert_eq!(false, number_set_should_list_remaining(0, usize::MAX));
}
#[test]
fn test_stay_positive_large_remaining_second() {
assert_eq!(false, number_set_should_list_remaining(1, std::usize::MAX));
assert_eq!(false, number_set_should_list_remaining(1, usize::MAX));
}
#[test]
fn test_stay_positive_large_remaining_tenth() {
assert_eq!(false, number_set_should_list_remaining(9, std::usize::MAX));
assert_eq!(false, number_set_should_list_remaining(9, usize::MAX));
}
#[test]
@ -585,17 +585,14 @@ mod test_number_set_decision {
// Ensure that we are overflow-free:
#[test]
fn test_no_crash_exceed_max_size1() {
assert_eq!(
false,
number_set_should_list_remaining(12345, std::usize::MAX)
);
assert_eq!(false, number_set_should_list_remaining(12345, usize::MAX));
}
#[test]
fn test_no_crash_exceed_max_size2() {
assert_eq!(
true,
number_set_should_list_remaining(std::usize::MAX - 1, std::usize::MAX)
number_set_should_list_remaining(usize::MAX - 1, usize::MAX)
);
}
@ -603,7 +600,7 @@ mod test_number_set_decision {
fn test_no_crash_exceed_max_size3() {
assert_eq!(
true,
number_set_should_list_remaining(std::usize::MAX, std::usize::MAX)
number_set_should_list_remaining(usize::MAX, usize::MAX)
);
}
}