Skip to content

Commit 72d650c

Browse files
committed
automata: replace uses of deprecated module integer constants
1 parent ada2a5a commit 72d650c

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

‎regex-automata/src/nfa/thompson/pikevm.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,7 @@ impl PikeVM {
12381238
// length that fits into isize, and so this assert should always pass.
12391239
// But we put it here to make our assumption explicit.
12401240
assert!(
1241-
input.haystack().len() < core::usize::MAX,
1241+
input.haystack().len() < usize::MAX,
12421242
"byte slice lengths must be less than usize MAX",
12431243
);
12441244
instrument!(|c| c.reset(&self.nfa));
@@ -1413,7 +1413,7 @@ impl PikeVM {
14131413
return;
14141414
}
14151415
assert!(
1416-
input.haystack().len() < core::usize::MAX,
1416+
input.haystack().len() < usize::MAX,
14171417
"byte slice lengths must be less than usize MAX",
14181418
);
14191419
instrument!(|c| c.reset(&self.nfa));

‎regex-automata/src/util/primitives.rs‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,11 @@ impl SmallIndex {
148148
#[cfg(any(target_pointer_width = "32", target_pointer_width = "64"))]
149149
pub const MAX: SmallIndex =
150150
// FIXME: Use as_usize() once const functions in traits are stable.
151-
SmallIndex::new_unchecked(core::i32::MAX as usize - 1);
151+
SmallIndex::new_unchecked(i32::MAX as usize - 1);
152152

153153
/// The maximum index value.
154154
#[cfg(target_pointer_width = "16")]
155-
pub const MAX: SmallIndex =
156-
SmallIndex::new_unchecked(core::isize::MAX - 1);
155+
pub const MAX: SmallIndex = SmallIndex::new_unchecked(isize::MAX - 1);
157156

158157
/// The total number of values that can be represented as a small index.
159158
pub const LIMIT: usize = SmallIndex::MAX.as_usize() + 1;

0 commit comments

Comments
 (0)