[][src]Function rand_split::split_parts

pub fn split_parts<'a, T>(cont: &'a mut [T], splits: &[f32]) -> Vec<&'a mut [T]> where
    T: Clone

Split the elements of a container in randomized sets which contain a a part (in splits) of the input.

Example

use rand_split::split_parts;

println!("{:#?}", split_parts(&mut [1,2,3,4,5,6,8,9,10], &[0.4, 0.2, 0.4]));