Skip to content

Commit 4df023a

Browse files
Fix variable name
1 parent 111405b commit 4df023a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ impl<T, const N: usize> StaticVec<T, N> {
463463
// This is the same aliasing-avoidance / optimization-trick approach used by regular Vec.
464464
let res = self.data.as_ptr() as *const T;
465465
// A pointer to "element zero" of an array is never null.
466-
unsafe { assume(!ptr.is_null()); }
466+
unsafe { assume(!res.is_null()); }
467467
res
468468
}
469469

@@ -484,7 +484,7 @@ impl<T, const N: usize> StaticVec<T, N> {
484484
pub const fn as_mut_ptr(&mut self) -> *mut T {
485485
// See the comment above in `as_ptr()`.
486486
let res = self.data.as_mut_ptr() as *mut T;
487-
unsafe { assume(!ptr.is_null()); }
487+
unsafe { assume(!res.is_null()); }
488488
res
489489
}
490490

@@ -2616,7 +2616,7 @@ impl<T, const N: usize> StaticVec<T, N> {
26162616
#[inline(always)]
26172617
pub(crate) const fn first_ptr(this: &MaybeUninit<[T; N]>) -> *const T {
26182618
let res = this.as_ptr() as *const T;
2619-
unsafe { assume(!ptr.is_null()); }
2619+
unsafe { assume(!res.is_null()); }
26202620
res
26212621
}
26222622

@@ -2626,7 +2626,7 @@ impl<T, const N: usize> StaticVec<T, N> {
26262626
#[inline(always)]
26272627
pub(crate) const fn first_ptr_mut(this: &mut MaybeUninit<[T; N]>) -> *mut T {
26282628
let res = this.as_mut_ptr() as *mut T;
2629-
unsafe { assume(!ptr.is_null()); }
2629+
unsafe { assume(!res.is_null()); }
26302630
res
26312631
}
26322632
}

0 commit comments

Comments
 (0)