mirror of
https://github.com/Lokathor/bytemuck.git
synced 2024-11-22 06:42:25 +00:00
commentary fix
This commit is contained in:
parent
7584fb2d19
commit
372ad15af9
@ -122,7 +122,8 @@ pub fn try_cast_vec<A: Pod, B: Pod>(input: Vec<A>) -> Result<Vec<B>, (PodCastErr
|
||||
let capacity: usize = input.capacity();
|
||||
// Note(Lokathor): Next we "pre-forget" the old Vec by wrapping with
|
||||
// ManuallyDrop, because if we used `core::mem::forget` after taking the
|
||||
// pointer then that would invalidate our pointer.
|
||||
// pointer then that would invalidate our pointer (I think? If not this
|
||||
// still doesn't hurt).
|
||||
let mut manual_drop_vec = ManuallyDrop::new(input);
|
||||
// Note(Lokathor): Finally, we carefully get the pointer we need, cast the
|
||||
// type, and then make a new Vec to return. This works all the way back to
|
||||
|
Loading…
Reference in New Issue
Block a user