update fifth-extras

Signed-off-by: husharp <jinhao.hu@pingcap.com>
pull/1112/head
husharp 2 years ago
parent ffe20cceb9
commit a53a404fb8

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

Loading…
Cancel
Save