villa01-data-structures 0.2.0

Personal crate of me trying to implement data structures and algorithms in Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use super::DoublyLinkedList;

impl<T> Drop for DoublyLinkedList<T> {
    fn drop(&mut self) {
        let mut cursor = self.head;
        while let Some(node) = cursor {
            unsafe {
                // Deallocating memory from heap to avoid memory leakage
                let _ = Box::from_raw(node);
                cursor = (*node).next;
            }
        }
    }
}