algorithmz 0.9.4

This is the corresponding implemenation of the python module of the same name.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use algorithmz::array::rotate;

#[test]
fn test_rotate_empty() {
    let result = rotate(&[],3);
    assert!(matches!(result, Err(ref e) if e == "Cannot rotate an empty list!"));
}

#[test]
fn test_rotate() {
    let result = rotate(&[1,2,3,4],4).unwrap();
    assert_eq!(result,vec![1,2,3,4]);
}