Skip to content

Commit 53bce57

Browse files
committed
Fix the MAX to max_value() for ancient rustc support.
1 parent 2cc6889 commit 53bce57

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/common.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ impl<'a> AsciiStr<'a> {
2828
#[inline]
2929
pub unsafe fn step_by(&mut self, n: usize) -> &mut Self {
3030
debug_assert!(
31-
n < isize::MAX as usize && n as isize <= self.len(),
31+
// FIXME: remove when we drop support for < 1.43.0
32+
n < isize::max_value() as usize && n as isize <= self.len(),
3233
"buffer overflow: stepping by greater than our buffer length."
3334
);
3435
// SAFETY: Safe if `n <= self.len()`

0 commit comments

Comments
 (0)