by nunchuckninja · 7y ago · 0 comments
I have a use case where I have two iterators on a linked list in nested loops and the second iterators deletes some elements as it goes. Is this something I can express in unsafe rust?
C:
``` node prime= list.head;
while () { node
probe = prime.next; while()
{
if () //condition on prime.data and probe.data {
probe.next = probe.next.next; //& drop stuff
}
}
```