fn check_names<'a>(cmd_pairs: &[(String, Command)], tests: &HashMap<String, TestCmd<'a>>) {
    let cmd_names = cmd_pairs.iter().map(|x| &x.0).collect::<HashSet<_>>();
    let test_names = tests.keys().map(|x| x).collect::<HashSet<_>>();
    let diff = test_names
        .difference(&cmd_names)
        .map(|x| x.as_str())
        .collect::<Vec<_>>();
    if !diff.is_empty() {
        fatal(&format!(
            "Command name(s) '{}' in tests are not found in the actual commands.",
            diff.join(", ")
        ));
    }
}
/// Check for the case where the user has a test called `X` but `test_cmds` doesn't have a command
/// with a matching name. This is almost certainly a bug, in the sense that the test can never,
/// ever fire.
Check for the case where the user has a test called `X` but `test_cmds` doesn't have a command
with a matching name. This is almost certainly a bug, in the sense that the test can never,
ever fire.
Check for the case where the user has a test called ` X ` but ` test_cmds ` doesn ' t have a command with a matching name . This is almost certainly a bug in the sense that the test can never ever fire .
fn check_names<'a>(cmd_pairs: &[(String, Command)], tests: &HashMap<String, TestCmd<'a>>) {
    let cmd_names = cmd_pairs.iter().map(|x| &x.0).collect::<HashSet<_>>();
    let test_names = tests.keys().map(|x| x).collect::<HashSet<_>>();
    let diff = test_names
        .difference(&cmd_names)
        .map(|x| x.as_str())
        .collect::<Vec<_>>();
    if !diff.is_empty() {
        fatal(&format!(
            "Command name(s) '{}' in tests are not found in the actual commands.",
            diff.join(", ")
        ));
    }
}
fn check_names < ' a > ( cmd_pairs : & [ ( String , Command ) ] , tests : & HashMap < String , TestCmd < ' a > > ) { let cmd_names = cmd_pairs . iter ( ) . map ( | x | & x . 0 ) . collect :: < HashSet < _ > > ( ) ; let test_names = tests . keys ( ) . map ( | x | x ) . collect :: < HashSet < _ > > ( ) ; let diff = test_names . difference ( & cmd_names ) . map ( | x | x . as_str ( ) ) . collect :: < Vec < _ > > ( ) ; if ! diff . is_empty ( ) { fatal ( & format ! ( " " diff join ( " " ) ) ) ; } }
Check for the case where the user has a test called `X` but `test_cmds` doesn't have a command
with a matching name.
Check for the case where the user has a test called ` X ` but ` test_cmds ` doesn ' t have a command with a matching name .
cmd_pairs
&[(String, Command)]
tests
&HashMap<String, TestCmd<'a>>
cmd_pairs
&[(String, Command)]
tests
&HashMap<String, TestCmd<'a>>