fn reduce_factors(factors: &mut Vec<(usize, usize)>, ks: &Vec<(usize, usize)>) {
    'outer: for &(f, c) in ks {
        for mut ft in factors.iter_mut() {
            if ft.0 == f {
                // panic on underflow if too many factors to reduce
                *ft = (ft.0, ft.1 - c);
                continue 'outer;
            }
        }

        // We did not find the factor, so panic
        panic!("could not find factor");
    }

    // Remove factors which are length 0
    factors.retain(|&(_, c)| c > 0);
}
/// Reduce factors from two lists of factors. This is equivalent to dividing a
/// number by another. If we cannot divide exactly, panic.
Reduce factors from two lists of factors. This is equivalent to dividing a
number by another. If we cannot divide exactly, panic.
Reduce factors from two lists of factors . This is equivalent to dividing a number by another . If we cannot divide exactly panic .
fn reduce_factors(factors: &mut Vec<(usize, usize)>, ks: &Vec<(usize, usize)>) {
    'outer: for &(f, c) in ks {
        for mut ft in factors.iter_mut() {
            if ft.0 == f {
                // panic on underflow if too many factors to reduce
                *ft = (ft.0, ft.1 - c);
                continue 'outer;
            }
        }
        // We did not find the factor, so panic
        panic!("could not find factor");
    }
    // Remove factors which are length 0
    factors.retain(|&(_, c)| c > 0);
}
fn reduce_factors ( factors : & mut Vec < ( usize , usize ) > , ks : & Vec < ( usize , usize ) > ) { ' outer : for & ( f , c ) in ks { for mut ft in factors . iter_mut ( ) { if ft . 0 == f { // panic on underflow if too many factors to reduce * ft = ( ft . 0 , ft . 1 - c ) ; continue ' outer ; } } // We did not find the factor, so panic panic ! ( " " ) ; } // Remove factors which are length 0 factors . retain ( | & ( _ , c ) | c > 0 ) ; }
Reduce factors from two lists of factors.
Reduce factors from two lists of factors .
factors
&mut Vec<(usize, usize)>
ks
&Vec<(usize, usize)>