File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,11 +20,11 @@ fn memchr_inner(needle: u8, haystack: &[u8]) -> Option<usize> {
2020 if ptr. is_null ( ) {
2121 None
2222 } else {
23- // SAFETY: `ptr` will always be in bounds, since libc guarentees that the ptr will either
23+ // SAFETY: `ptr` will always be in bounds, since libc guarantees that the ptr will either
2424 // be to an element inside the array or the ptr will be null
2525 // since the ptr is in bounds the offset must also always be non null
2626 // and there can't be more than isize::MAX elements inside an array
27- // as rust guarentees that the maximum number of bytes a allocation
27+ // as rust guarantees that the maximum number of bytes a allocation
2828 // may occupy is isize::MAX
2929 unsafe {
3030 // TODO(MSRV 1.87): When bumping MSRV, switch to `ptr.byte_offset_from_unsigned(start)`.
@@ -38,7 +38,7 @@ pub(crate) fn memchr(needle: u8, haystack: &[u8]) -> Option<usize> {
3838
3939 // SAFETY: `memchr_inner` returns Some(index) and in that case index must point to an element in haystack
4040 // or `memchr_inner` None which is guarded by the `?` operator above
41- // therfore the index must **always** point to an element in the array
41+ // therefore the index must **always** point to an element in the array
4242 // and so this indexing operation is safe
4343 // TODO(MSRV 1.81): When bumping MSRV, switch to `std::hint::assert_unchecked(haystack.get(..=index).is_some());`
4444 unsafe {
You can’t perform that action at this time.
0 commit comments