Skip to content

Commit 4dff9f2

Browse files
authored
chore: fix some typos in comments (#399)
Signed-off-by: luohewuyang <luohewuyang@outlook.com>
1 parent 74f73e4 commit 4dff9f2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ impl<T, const N: usize> SmallVec<T, N> {
849849
pub const fn from_buf<const S: usize>(elements: [T; S]) -> Self {
850850
const { assert!(S <= N); }
851851

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

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

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

866866
// SAFETY: all the members in 0..S are initialized
@@ -2233,7 +2233,7 @@ mod spec_traits {
22332233
let len = src.len();
22342234

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

0 commit comments

Comments
 (0)