too-many-lists
too-many-lists copied to clipboard
Add a test to check stack overflow in "fist-drop" section
I think it is great to add a test to this section to cause stack overflow before implementing our own Drop
.
You can try this in the playground. refering to this post
tried a bit: playground-2 versions of drop
found that without impl Drop
the prog would go stack overflow; with either version of drop
it can run successfully.
can i say that both versions of drop
are correct ?
while let Some(mut b) = self.head.take() { self.head = b.next.take(); }
while let Some(b) = self.head.take() { self.head = b.next; }