File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ use std::hash::{Hash, Hasher};
99use std:: marker:: PhantomData ;
1010use std:: ops:: { Deref , RangeBounds } ;
1111
12- use bytes:: { Buf , Bytes , BytesMut } ;
12+ use bytes:: { Buf , Bytes } ;
1313use vortex_error:: { VortexExpect , vortex_panic} ;
1414
1515use crate :: debug:: TruncatedDebug ;
@@ -419,14 +419,8 @@ impl<T> Buffer<T> {
419419
420420 /// Convert self into `BufferMut<T>`, cloning the data if there are multiple strong references.
421421 pub fn into_mut ( self ) -> BufferMut < T > {
422- let new_bytes = self . bytes . try_into_mut ( ) . unwrap_or_else ( BytesMut :: from) ;
423-
424- BufferMut {
425- bytes : new_bytes,
426- length : self . length ,
427- alignment : self . alignment ,
428- _marker : Default :: default ( ) ,
429- }
422+ self . try_into_mut ( )
423+ . unwrap_or_else ( |buffer| BufferMut :: < T > :: copy_from ( & buffer) )
430424 }
431425
432426 /// Returns whether a `Buffer<T>` is aligned to the given alignment.
You can’t perform that action at this time.
0 commit comments