Skip to main content

split_parts

Function split_parts 

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

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]));