Skip to content

Commit

Permalink
Simplify code.
Browse files Browse the repository at this point in the history
  • Loading branch information
caibear committed Mar 21, 2024
1 parent 876ffb1 commit ef111dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ impl<'a, T: Copy, const N: usize> FastArrayVec<'a, T, N> {

#[inline(always)]
pub fn as_slice(&self) -> &[T] {
let len = (self.end as usize - self.start as usize) / std::mem::size_of::<T>();
let len = sub_ptr(self.end, self.start);
unsafe { std::slice::from_raw_parts(self.start, len) }
}
}
Expand Down

0 comments on commit ef111dd

Please sign in to comment.