Skip to content

Commit 2331294

Browse files
committed
fix(buffer): borrow bit buffer allocators
Signed-off-by: Nicholas Gates <nick@nickgates.com>
1 parent 6477a2c commit 2331294

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

vortex-buffer/src/bit/buf_mut.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,7 @@ impl BitBufferMut {
119119

120120
/// Creates a `BitBufferMut` from a [`BitBuffer`] by copying all of the data over.
121121
pub fn copy_from(bit_buffer: &BitBuffer) -> Self {
122-
let allocator = bit_buffer
123-
.inner()
124-
.allocator()
125-
.unwrap_or_else(BufferAllocatorRef::statically_allocated);
126-
Self::copy_from_in(bit_buffer, allocator)
122+
Self::copy_from_in(bit_buffer, bit_buffer.inner().allocator().clone())
127123
}
128124

129125
/// Copies a bit buffer with the provided allocator.
@@ -184,7 +180,7 @@ impl BitBufferMut {
184180
}
185181

186182
/// Returns the allocator that owns this buffer.
187-
pub fn allocator(&self) -> BufferAllocatorRef {
183+
pub fn allocator(&self) -> &BufferAllocatorRef {
188184
self.buffer.allocator()
189185
}
190186

0 commit comments

Comments
 (0)