From ddbf6a42290afff1767b687b241fe58f31dd8db3 Mon Sep 17 00:00:00 2001 From: Denimworld12 <166978100+Denimworld12@users.noreply.github.com> Date: Tue, 22 Sep 2026 20:39:59 +0530 Subject: [PATCH] style: rename alloc to allocator Signed-off-by: Denimworld12 <166978100+Denimworld12@users.noreply.github.com> --- src/lib.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 1822729..395de98 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -919,7 +919,7 @@ impl SmallVec { ptr: ptr.cast(), size_bytes: old_cap * size_of::(), align: align_of::(), - alloc: &self.allocator + allocator: &self.allocator }); self.set_inline(); } @@ -1570,16 +1570,16 @@ impl SmallVec { } } - pub const fn new_in(alloc: A) -> SmallVec { + pub const fn new_in(allocator: A) -> SmallVec { Self { len: TaggedLen::new(0, false), raw: RawSmallVec::new(), - allocator: alloc + allocator } } - pub fn try_with_capacity_in(capacity: usize, alloc: A) -> Result { - let mut this = Self::new_in(alloc); + pub fn try_with_capacity_in(capacity: usize, allocator: A) -> Result { + let mut this = Self::new_in(allocator); if capacity > Self::inline_size() && !Self::IS_ZST { // SAFETY: we checked all the preconditions unsafe { @@ -1593,8 +1593,8 @@ impl SmallVec { Ok(this) } - pub fn with_capacity_in(capacity: usize, alloc: A) -> Self { - Self::try_with_capacity_in(capacity, alloc).unwrap_or_else(SmallVecError::handle) + pub fn with_capacity_in(capacity: usize, allocator: A) -> Self { + Self::try_with_capacity_in(capacity, allocator).unwrap_or_else(SmallVecError::handle) } } @@ -1701,7 +1701,7 @@ struct DropDealloc<'a, A: Allocator> { ptr: NonNull, size_bytes: usize, align: usize, - alloc: &'a A + allocator: &'a A } impl Drop for DropDealloc<'_, A> { @@ -1709,7 +1709,7 @@ impl Drop for DropDealloc<'_, A> { fn drop(&mut self) { unsafe { if self.size_bytes > 0 { - self.alloc.deallocate( + self.allocator.deallocate( self.ptr, Layout::from_size_align_unchecked(self.size_bytes, self.align) ); @@ -1731,7 +1731,7 @@ impl Drop for SmallVec { ptr: NonNull::new_unchecked(ptr as *mut u8), size_bytes: capacity * size_of::(), align: align_of::(), - alloc: &self.allocator + allocator: &self.allocator }) } else { None @@ -1754,7 +1754,7 @@ impl Drop for IntoIter { ptr: NonNull::new_unchecked(ptr as *mut u8), size_bytes: capacity * size_of::(), align: align_of::(), - alloc: &self.allocator + allocator: &self.allocator }) } else { None