Upgrade to Rust v1.49.0

This commit is contained in:
Michael Vines
2021-01-23 11:55:15 -08:00
parent 7604edb16f
commit cbffab7850
36 changed files with 156 additions and 132 deletions

View File

@@ -89,18 +89,17 @@ impl<T: Clone + Default + Sized> Default for PinnedVec<T> {
}
}
impl<T: Clone + Default + Sized> Into<Vec<T>> for PinnedVec<T> {
fn into(mut self) -> Vec<T> {
if self.pinned {
unpin(self.x.as_mut_ptr());
self.pinned = false;
impl<T: Clone + Default + Sized> From<PinnedVec<T>> for Vec<T> {
fn from(mut pinned_vec: PinnedVec<T>) -> Self {
if pinned_vec.pinned {
unpin(pinned_vec.x.as_mut_ptr());
pinned_vec.pinned = false;
}
self.pinnable = false;
self.recycler = None;
std::mem::take(&mut self.x)
pinned_vec.pinnable = false;
pinned_vec.recycler = None;
std::mem::take(&mut pinned_vec.x)
}
}
pub struct PinnedIter<'a, T>(std::slice::Iter<'a, T>);
pub struct PinnedIterMut<'a, T>(std::slice::IterMut<'a, T>);