Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ impl<T, const N: usize> SmallVec<T, N> {
pub const fn from_buf<const S: usize>(elements: [T; S]) -> Self {
const { assert!(S <= N); }

// Althought we create a new buffer, since S and N are known at compile time,
// Although we create a new buffer, since S and N are known at compile time,
// even with `-C opt-level=1`, it gets optimized as best as it could be. (Checked with <godbolt.org>)
let mut buf: MaybeUninit<[T; N]> = MaybeUninit::uninit();

Expand All @@ -860,7 +860,7 @@ impl<T, const N: usize> SmallVec<T, N> {
copy_nonoverlapping(elements.as_ptr(), buf.as_mut_ptr() as *mut T, S);
}

// `elements` have been moved into buf and will be droped by SmallVec
// `elements` have been moved into buf and will be dropped by SmallVec
core::mem::forget(elements);

// SAFETY: all the members in 0..S are initialized
Expand Down Expand Up @@ -2230,7 +2230,7 @@ mod spec_traits {
let len = src.len();

// SAFETY: The caller ensures that the vector has spare capacity
// for at least `src.len()` elements. This is alse the amount of memory
// for at least `src.len()` elements. This is also the amount of memory
// accessed when the data is copied.
unsafe {
let ptr = self.as_mut_ptr();
Expand Down