algorithmz 1.0.9

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
14
use algorithmz::array::limit;


#[test]
fn test_limit_empty() {
    let result = limit(&[],2,4);
    assert!(matches!(result, Err(ref e) if e == "Cannot use limit on an empty list!"));
}

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