TheAlgorithms/Rust

delete head is not returning None, causing length update overflow

zinking opened this issue · 7 comments

while self.delete_head().is_some() {}

it looks the implementation of drop is flawed and delete head is not returning none to terminate the drop process appropriately.

RoKu1 commented

Hey, Is this open to take ?

Yes, it is

RoKu1 commented

Hey will take it. As I see if delete_head does not return None, still the drop should terminate. Can you give me bit context as to what is causing this lenth update overflow.

@RoKu1 https://github.com/zinking/Coursera/blob/master/rust-course/src/ds/linked_list.rs it could be my re-imp problem. I ended up using linked list size as loop variable.

RoKu1 commented

Hi, I took a look at your implementation.
The current in implementation I do not see anywhere that the delete_head won't return None.
I guess this can be closed @siriak

@zinking please add more information, and I'll reopen this issue if it's still relevant