Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2951215

Browse files
committedJun 20, 2021
Fixes #28.
1 parent ec1b7d4 commit 2951215

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎src/common.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ impl<'a> AsciiStr<'a> {
7575

7676
#[inline]
7777
pub fn check_len(&self, n: usize) -> bool {
78-
unsafe { self.ptr.add(n) <= self.end }
78+
let len = self.end as usize - self.ptr as usize;
79+
n <= len
7980
}
8081

8182
#[inline]

0 commit comments

Comments
 (0)
Please sign in to comment.