fn generate_loadouts(input: &Battle) -> Vec<[&Equipment; 4]> {
    let mut loadouts = Vec::new();

    for weapon in input.weapons.iter() {
        for armour in input.armour.iter() {
            for rings in input.rings.iter().combinations(2) {
                let equipment = [weapon, armour, rings[0], rings[1]];
                loadouts.push(equipment);
            }
        }
    }

    loadouts
}
/// Generate all the possible different loadouts of equipment that can be
/// equipped by the hero
Generate all the possible different loadouts of equipment that can be
equipped by the hero
Generate all the possible different loadouts of equipment that can be equipped by the hero
fn generate_loadouts(input: &Battle) -> Vec<[&Equipment; 4]> {
    let mut loadouts = Vec::new();
    for weapon in input.weapons.iter() {
        for armour in input.armour.iter() {
            for rings in input.rings.iter().combinations(2) {
                let equipment = [weapon, armour, rings[0], rings[1]];
                loadouts.push(equipment);
            }
        }
    }
    loadouts
}
fn generate_loadouts ( input : & Battle ) -> Vec < [ & Equipment ; 4 ] > { let mut loadouts = Vec :: new ( ) ; for weapon in input . weapons . iter ( ) { for armour in input . armour . iter ( ) { for rings in input . rings . iter ( ) . combinations ( 2 ) { let equipment = [ weapon , armour , rings [ 0 ] , rings [ 1 ] ] ; loadouts . push ( equipment ) ; } } } loadouts }
Generate all the possible different loadouts of equipment that can be
equipped by the hero
Generate all the possible different loadouts of equipment that can be equipped by the hero
input
&Battle
input
&Battle