/// Checks the dependency of WHITELIST_CRATES at the given path. Changes `bad` to `true` if a check
/// failed.
///
/// Specifically, this checks that the dependencies are on the WHITELIST.
Checks the dependency of WHITELIST_CRATES at the given path. Changes `bad` to `true` if a check
failed.

Specifically, this checks that the dependencies are on the WHITELIST.
Checks the dependency of WHITELIST_CRATES at the given path . Changes ` bad ` to ` true ` if a check failed . Specifically this checks that the dependencies are on the WHITELIST .
pub fn check_whitelist(path: &Path, cargo: &Path, bad: &mut bool) {
    // Get dependencies from cargo metadata
    let resolve = get_deps(path, cargo);
    // Get the whitelist into a convenient form
    let whitelist: HashSet<_> = WHITELIST.iter().cloned().collect();
    // Check dependencies
    let mut visited = BTreeSet::new();
    let mut unapproved = BTreeSet::new();
    for &krate in WHITELIST_CRATES.iter() {
        let mut bad = check_crate_whitelist(&whitelist, &resolve, &mut visited, krate, false);
        unapproved.append(&mut bad);
    }
    if unapproved.len() > 0 {
        println!("Dependencies not on the whitelist:");
        for dep in unapproved {
            println!("* {}", dep.id_str());
        }
        *bad = true;
    }
    check_crate_duplicate(&resolve, bad);
}
pub fn check_whitelist ( path : & Path , cargo : & Path , bad : & mut bool ) { // Get dependencies from cargo metadata let resolve = get_deps ( path , cargo ) ; // Get the whitelist into a convenient form let whitelist : HashSet < _ > = WHITELIST . iter ( ) . cloned ( ) . collect ( ) ; // Check dependencies let mut visited = BTreeSet :: new ( ) ; let mut unapproved = BTreeSet :: new ( ) ; for & krate in WHITELIST_CRATES . iter ( ) { let mut bad = check_crate_whitelist ( & whitelist , & resolve , & mut visited , krate , false ) ; unapproved . append ( & mut bad ) ; } if unapproved . len ( ) > 0 { println ! ( " " ) ; for dep in unapproved { println ! ( " " dep id_str ( ) ) ; } * bad = true ; } check_crate_duplicate ( & resolve , bad ) ; }
Checks the dependency of WHITELIST_CRATES at the given path.
Checks the dependency of WHITELIST_CRATES at the given path .
path
&Path
cargo
&Path
bad
&mut bool