Merge pull request #1112 from HuSharp/too-many-lists-unsafe-queue

update fifth-extras
pull/1124/head
Sunface 2 years ago committed by GitHub
commit c2fd151d81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -141,10 +141,12 @@ impl<'a, T> Iterator for Iter<'a, T> {
type Item = &'a T;
fn next(&mut self) -> Option<Self::Item> {
self.next.map(|node| {
self.next = node.next.as_deref();
&node.elem
})
unsafe {
self.next.map(|node| {
self.next = node.next.as_ref();
&node.elem
})
}
}
}
@ -152,10 +154,12 @@ impl<'a, T> Iterator for IterMut<'a, T> {
type Item = &'a mut T;
fn next(&mut self) -> Option<Self::Item> {
self.next.take().map(|node| {
self.next = node.next.as_deref_mut();
&mut node.elem
})
unsafe {
self.next.take().map(|node| {
self.next = node.next.as_mut();
&mut node.elem
})
}
}
}
```

Loading…
Cancel
Save