fn guess_rotor_and_first_key<F: FitnessFn>(msg: &str) -> Enigma {
    let (rotor, key) = iproduct!(ROTORS.iter(), ALPHAS.iter())
        .collect::<Vec<_>>()
        .into_par_iter()
        .max_by_key(|&(rotor, key)| {
            let mut enigma = Enigma::new(rotor, key, "AAA", 'B', "");
            OrderedFloat(F::score(&enigma.encrypt(msg)))
        }).unwrap();

    Enigma::new(rotor, key, "AAA", 'B', "")
}
/// Given a piece of ciphertext and a fitness function, tries all valid rotor
/// and key combinations, and returns an `Enigma` with rotor settings and
/// first key setting that best decrypt the ciphertext. Note that the other
/// key settings and ring settings will be meaningless at this point.
///
/// This method checks 60 * 26^3 == 1,054,560 settings in parallel.
Given a piece of ciphertext and a fitness function, tries all valid rotor
and key combinations, and returns an `Enigma` with rotor settings and
first key setting that best decrypt the ciphertext. Note that the other
key settings and ring settings will be meaningless at this point.


Given a piece of ciphertext and a fitness function tries all valid rotor and key combinations and returns an ` Enigma ` with rotor settings and first key setting that best decrypt the ciphertext . Note that the other key settings and ring settings will be meaningless at this point .
fn guess_rotor_and_first_key<F: FitnessFn>(msg: &str) -> Enigma {
    let (rotor, key) = iproduct!(ROTORS.iter(), ALPHAS.iter())
        .collect::<Vec<_>>()
        .into_par_iter()
        .max_by_key(|&(rotor, key)| {
            let mut enigma = Enigma::new(rotor, key, "AAA", 'B', "");
            OrderedFloat(F::score(&enigma.encrypt(msg)))
        }).unwrap();
    Enigma::new(rotor, key, "AAA", 'B', "")
}
fn guess_rotor_and_first_key < F : FitnessFn > ( msg : & str ) -> Enigma { let ( rotor , key ) = iproduct ! ( ROTORS iter ( ) ALPHAS iter ( ) ) . collect :: < Vec < _ > > ( ) . into_par_iter ( ) . max_by_key ( | & ( rotor , key ) | { let mut enigma = Enigma :: new ( rotor , key , " " , 'B' , " " ) ; OrderedFloat ( F :: score ( & enigma . encrypt ( msg ) ) ) } ) . unwrap ( ) ; Enigma :: new ( rotor , key , " " , 'B' , " " ) }
Given a piece of ciphertext and a fitness function, tries all valid rotor
and key combinations, and returns an `Enigma` with rotor settings and
first key setting that best decrypt the ciphertext.
Given a piece of ciphertext and a fitness function tries all valid rotor and key combinations and returns an ` Enigma ` with rotor settings and first key setting that best decrypt the ciphertext .
msg
&str
msg
&str