thin-vec icon indicating copy to clipboard operation
thin-vec copied to clipboard

Make `Drain<'_, T>` covariant in `T`.

Open zachs18 opened this issue 1 year ago • 0 comments

Since we only ever ptr::read from the references returned by self.iter.next(), they can just as well be shared references as mutable ones, so we use Iter instead of IterMut to get covariance. *mut ThinVec<T> becomes NonNull<ThinVec<T>> for covariance also.

zachs18 avatar Aug 01 '24 07:08 zachs18