fn split_into_columns<T: Clone>(words: &Vec<T>, columns: usize, lines_amt: usize) -> Vec<Vec<T>> {
        assert!(words.len() <= columns * lines_amt);
        let mut outputs: Vec<Vec<T>> = Vec::new();
        for _ in 0..columns {
            outputs.push(Vec::new())
        }
        let mut i = 0;
        'outer: for output in &mut outputs {
            let mut j = 0;
            while j < lines_amt {
                if i >= words.len() {
                    break 'outer;
                }
                output.push(words.get(i).unwrap().clone());
                i += 1;
                j += 1;
            }
        }
        outputs
    }
/// splits a vector of cloneables into a vector of vectors of cloneables where lines_amt
/// is the length of the outer vector and columns the max len of the inner vector
splits a vector of cloneables into a vector of vectors of cloneables where lines_amt
is the length of the outer vector and columns the max len of the inner vector
splits a vector of cloneables into a vector of vectors of cloneables where lines_amt is the length of the outer vector and columns the max len of the inner vector
fn split_into_columns<T: Clone>(words: &Vec<T>, columns: usize, lines_amt: usize) -> Vec<Vec<T>> {
        assert!(words.len() <= columns * lines_amt);
        let mut outputs: Vec<Vec<T>> = Vec::new();
        for _ in 0..columns {
            outputs.push(Vec::new())
        }
        let mut i = 0;
        'outer: for output in &mut outputs {
            let mut j = 0;
            while j < lines_amt {
                if i >= words.len() {
                    break 'outer;
                }
                output.push(words.get(i).unwrap().clone());
                i += 1;
                j += 1;
            }
        }
        outputs
    }
fn split_into_columns < T : Clone > ( words : & Vec < T > , columns : usize , lines_amt : usize ) -> Vec < Vec < T > > { assert ! ( words len ( ) columns lines_amt ) ; let mut outputs : Vec < Vec < T > > = Vec :: new ( ) ; for _ in 0 .. columns { outputs . push ( Vec :: new ( ) ) } let mut i = 0 ; ' outer : for output in & mut outputs { let mut j = 0 ; while j < lines_amt { if i >= words . len ( ) { break ' outer ; } output . push ( words . get ( i ) . unwrap ( ) . clone ( ) ) ; i += 1 ; j += 1 ; } } outputs }
splits a vector of cloneables into a vector of vectors of cloneables where lines_amt
is the length of the outer vector and columns the max len of the inner vector
splits a vector of cloneables into a vector of vectors of cloneables where lines_amt is the length of the outer vector and columns the max len of the inner vector
words
&Vec<T>
columns
usize
lines_amt
usize