From 05ee003c83c0ac9455756db2c2f351aa8cd5d724 Mon Sep 17 00:00:00 2001 From: bolshoytoster Date: Thu, 3 Sep 2026 09:41:50 +0100 Subject: [PATCH] Minor style/bloat improvement --- src/lib.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 353bb23..8efb52e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1191,9 +1191,7 @@ impl SmallVec { let (mut ptr, mut len_ptr) = self.data.heap_mut(); if *len_ptr == self.capacity { self.reserve_one_unchecked(); - let (heap_ptr, heap_len) = self.data.heap_mut(); - ptr = heap_ptr; - len_ptr = heap_len; + (ptr, len_ptr) = self.data.heap_mut(); } ptr::write(ptr.as_ptr().add(*len_ptr), value); *len_ptr += 1; @@ -1202,9 +1200,7 @@ impl SmallVec { let mut len_ptr = &mut self.capacity; if *len_ptr == Self::inline_capacity() { self.reserve_one_unchecked(); - let (heap_ptr, heap_len) = self.data.heap_mut(); - ptr = heap_ptr; - len_ptr = heap_len; + (ptr, len_ptr) = self.data.heap_mut(); } ptr::write(ptr.as_ptr().add(*len_ptr), value); *len_ptr += 1; @@ -1461,9 +1457,7 @@ impl SmallVec { let (mut ptr, mut len_ptr, cap) = self.triple_mut(); if *len_ptr == cap { self.reserve_one_unchecked(); - let (heap_ptr, heap_len_ptr) = self.data.heap_mut(); - ptr = heap_ptr; - len_ptr = heap_len_ptr; + (ptr, len_ptr) = self.data.heap_mut(); } let mut ptr = ptr.as_ptr(); let len = *len_ptr;