Circular Linked List written in rust

crate docs

Inspired from the linux kernel list.

Basic usage

```rust use cll::CircularList;

let mut mylist = CircularList::default(); for x in 1..=5 { mylist.add(x); }

asserteq!(mylist.remove(), Some(1)); asserteq!(mylist.pop(), Some(5));

mylist.itermut().foreach(|x: &mut i32| *x -= 1); asserteq!(mylist.intoiter().collect::>(), &[1, 2, 3]); ```

Example of sorting using double_cursor

```rust use cll::list;

let mut list = list![3, 1, 8, 21, 5, 9, 12, 5, 2, 6, 6, 6, 13, 2, 17]; let len = list.len(); let mut dc = list .double_cursor() .expect("A cursor should always be available on a non empty list");

let mut min = *dc.valuea(); for i in 1..len { dc.setbtoa(); dc.pusha(); for _ in i..len { dc.movenexta(); let val = *dc.valuea(); if val < min { min = val; dc.setbtoa(); } } dc.popa(); dc.insertbbeforea(); if dc.aisb() { dc.movenexta(); } min = *dc.valuea(); } asserteq!( list.intoiter().collect::>(), &[1, 2, 2, 3, 5, 5, 6, 6, 6, 8, 9, 12, 13, 17, 21] ); ```