gear_combos 1.0.4

Attempts to make getting combinations of things easier with the use of gears and simple numeric states!
Documentation
use gear_combos;

/// Shows an example of API usage.
/// Begins by constructing a vector of gears and
/// getting the combinations of the gears.
/// It then prints each combination.
/// In this example it constructs a vector of 4 gears,
/// each of which can cycle between 4 states.
/// The combinations returned is 4^4 in len (256),
/// representing each unique combination of gears and 
/// states they can be in.
fn main() {
    let mut gears_vector = vec![
        gear_combos::Gear::new(4),
        gear_combos::Gear::new(4),
        gear_combos::Gear::new(4),
        gear_combos::Gear::new(4),
    ];

    for (i, combo) in gear_combos::get_gears_combinations(&mut gears_vector)
        .iter()
        .enumerate()
    {
        let mut c = String::new();
        c.push('[');
        for (j, d) in combo.iter().enumerate() {
            c.push_str(&d.to_string());
            if j < combo.len() - 1 {
                c.push(',');
            } else {
                c.push(']');
            }
        }
        println!("{} : {}", i, c);
    }
}