Skip to content

Commit d217cf5

Browse files
authored
Merge pull request #14 from Alexhuszagh/max
Fix the `MAX` to `max_value()` for ancient rustc support.
2 parents 2cc6889 + 53bce57 commit d217cf5

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)