File tree Expand file tree Collapse file tree 2 files changed +2
-17
lines changed
crates/bevy_ecs/src/storage Expand file tree Collapse file tree 2 files changed +2
-17
lines changed Original file line number Diff line number Diff line change 1
1
use alloc:: alloc:: handle_alloc_error;
2
2
use bevy_ptr:: { OwningPtr , Ptr , PtrMut } ;
3
3
use bevy_utils:: OnDrop ;
4
- use core:: { alloc:: Layout , num:: NonZero , ptr:: NonNull } ;
4
+ use core:: { alloc:: Layout , cell :: UnsafeCell , num:: NonZero , ptr:: NonNull } ;
5
5
6
6
/// A flat, type-erased data storage type
7
7
///
@@ -335,21 +335,6 @@ impl BlobVec {
335
335
unsafe { PtrMut :: new ( self . data ) }
336
336
}
337
337
338
- /// Get a reference to the entire [`BlobVec`] as if it were an array with elements of type `T`
339
- ///
340
- /// # Safety
341
- /// The type `T` must be the type of the items in this [`BlobVec`].
342
- pub unsafe fn get_slice < T > ( & self ) -> & [ UnsafeCell < T > ] {
343
- // SAFETY: the inner data will remain valid for as long as 'self.
344
- unsafe { core:: slice:: from_raw_parts ( self . data . as_ptr ( ) as * const UnsafeCell < T > , self . len ) }
345
- }
346
-
347
- /// Returns the drop function for values stored in the vector,
348
- /// or `None` if they don't need to be dropped.
349
- #[ inline]
350
- pub fn get_drop ( & self ) -> Option < unsafe fn ( OwningPtr < ' _ > ) > {
351
- self . drop
352
- }
353
338
/// Clears the vector, removing (and dropping) all values.
354
339
///
355
340
/// Note that this method has no effect on the allocated capacity of the vector.
Original file line number Diff line number Diff line change @@ -409,6 +409,6 @@ impl ThinColumn {
409
409
/// or `None` if they don't need to be dropped.
410
410
#[ inline]
411
411
pub fn get_drop ( & self ) -> Option < unsafe fn ( OwningPtr < ' _ > ) > {
412
- self . data . get_drop ( )
412
+ self . data . drop
413
413
}
414
414
}
You can’t perform that action at this time.
0 commit comments