Skip to content

Commit

Permalink
legacy numeric constant
Browse files Browse the repository at this point in the history
  • Loading branch information
koeppl committed Jan 11, 2025
1 parent bee5b74 commit 00ca44e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ pub fn compute_lcp<T: AsPrimitive<usize> + num::cast::FromPrimitive>(
lcp
}

pub const INVALID_VALUE: u32 = std::u32::MAX;
pub const INVALID_VALUE: u32 = u32::MAX;

pub fn compute_psv<T: Ord>(arr: &[T]) -> Vec<u32> {
let mut psv = vec![0; arr.len()];
Expand Down Expand Up @@ -408,8 +408,8 @@ impl Iterator for RandomStringGenerator {
debug_assert_lt!(std::mem::size_of_val(&iter_round) * 8, 200);
let most_significant_bit = bit_size(iter_round);

let alphabet_mask = std::usize::MAX
>> ((std::mem::size_of_val(&std::usize::MAX) * 8) as u8 - self.m_log_alphabet_size);
let alphabet_mask = usize::MAX
>> ((std::mem::size_of_val(&usize::MAX) * 8) as u8 - self.m_log_alphabet_size);
let mut text = Vec::new();
for i in 1..(most_significant_bit / self.m_log_alphabet_size) as usize {
text.push(
Expand Down Expand Up @@ -530,7 +530,7 @@ impl<'a, C: Eq + Copy + Clone> ConjugateIterator<'a, C> {
}
}

impl<'a, C: Eq + Copy + Clone> Iterator for ConjugateIterator<'a, C> {
impl<C: Eq + Copy + Clone> Iterator for ConjugateIterator<'_, C> {
type Item = Vec<C>;

fn next(&mut self) -> Option<Vec<C>> {
Expand Down
2 changes: 1 addition & 1 deletion src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub fn file2byte_vector(filename: &str, prefix_length: usize) -> Vec<u8> {
} else {
metadata.len()
};
assert!(buffer_length <= std::usize::MAX as u64);
assert!(buffer_length <= usize::MAX as u64);

let mut buffer = vec![0; buffer_length as usize];
f.read_exact(&mut buffer).unwrap();
Expand Down

0 comments on commit 00ca44e

Please sign in to comment.