algorithmz 0.8.5

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::longest_non_repeat;

#[test]
fn test_longest_non_repeat() {
    let result = longest_non_repeat("abcabcbb").unwrap();
    assert_eq!(result,(3,"abc".to_string()));
}

#[test]
fn test_longest_non_repeat_empty() {
    let result = longest_non_repeat("");
    assert!(matches!(result, Err(ref e) if e == "Cannot identify longest non repeat on an empty string!"));
}