Takes ownership of a
Vec that is being mapped in place, cleaning up if the map fails.
ptr: *mut T
_elem_tys: PhantomData<(T, U)>
Converts back into a
Vec once the map is complete.
VecMappedInPlace drops everything but the element that was passed to
map when it panicked or
returned an error. Everything before that index in the vector has type
U (it has been mapped)
and everything after it has type
T (it has not been mapped).
mapped | not yet mapped |----| |-----| [UUUU UxTT TTTT] ^ `map_in_progress` (not dropped)
Returns the argument unchanged.