Crate gradient_slice

Crate gradient_slice 

Source
Expand description

§Gradient Slice

gradient-slice is a safe crate to iterate over a gradient of permutations of slices of a Vec

§Example

use gradient_slice::Gradient;
let result = Gradient::new(" abc ".chars().collect::<Vec<char>>())
    .map(Vec::from)
    .map(|vec| {
        vec.iter()
            .map(Clone::clone)
            .map(String::from)
            .collect::<String>()
    })
    .collect::<Vec<String>>();
assert_eq!(
    result,
    vec![
        " ", "a", "b", "c", " ", " a", "ab", "bc", "c ", " ab", "abc", "bc ", " abc",
        "abc ", " abc "
    ]
);

Structs§

Gradient