pub fn check(root: &Path, bad: &mut bool) {
    // `Cargo.lock` of rust.
    let path = root.join("Cargo.lock");

    // Open and read the whole file.
    let cargo_lock = t!(fs::read_to_string(&path));

    // Process each line.
    for line in cargo_lock.lines() {
        // Consider only source entries.
        if !line.starts_with("source = ") {
            continue;
        }

        // Extract source value.
        let source = line.split_once('=').unwrap().1.trim();

        // Allow all soft-dev repos.
        // We also allow our personal forks for scenarios where we are breaking a CI cycle and need
        // to temporarily use one of our personal feature branches.
        if source.starts_with("\"git+https://github.com/softdevteam/")
            || source.starts_with("\"git+https://github.com/vext01/")
            || source.starts_with("\"git+https://github.com/ltratt/")
            || source.starts_with("\"git+https://github.com/ptersilie/")
            || source.starts_with("\"git+https://github.com/bjorn3/")
        {
            continue;
        }

        // Ensure source is whitelisted.
        if !ALLOWED_SOURCES.contains(&&*source) {
            tidy_error!(bad, "invalid source: {}", source);
        }
    }
}
/// Checks for external package sources. `root` is the path to the directory that contains the
/// workspace `Cargo.toml`.
Checks for external package sources. `root` is the path to the directory that contains the
workspace `Cargo.toml`.
Checks for external package sources . ` root ` is the path to the directory that contains the workspace ` Cargo . toml ` .
pub fn check(root: &Path, bad: &mut bool) {
    // `Cargo.lock` of rust.
    let path = root.join("Cargo.lock");
    // Open and read the whole file.
    let cargo_lock = t!(fs::read_to_string(&path));
    // Process each line.
    for line in cargo_lock.lines() {
        // Consider only source entries.
        if !line.starts_with("source = ") {
            continue;
        }
        // Extract source value.
        let source = line.split_once('=').unwrap().1.trim();
        // Allow all soft-dev repos.
        // We also allow our personal forks for scenarios where we are breaking a CI cycle and need
        // to temporarily use one of our personal feature branches.
        if source.starts_with("\"git+https://github.com/softdevteam/")
            || source.starts_with("\"git+https://github.com/vext01/")
            || source.starts_with("\"git+https://github.com/ltratt/")
            || source.starts_with("\"git+https://github.com/ptersilie/")
            || source.starts_with("\"git+https://github.com/bjorn3/")
        {
            continue;
        }
        // Ensure source is whitelisted.
        if !ALLOWED_SOURCES.contains(&&*source) {
            tidy_error!(bad, "invalid source: {}", source);
        }
    }
}
pub fn check ( root : & Path , bad : & mut bool ) { // `Cargo.lock` of rust. let path = root . join ( " " ) ; // Open and read the whole file. let cargo_lock = t ! ( fs read_to_string ( path ) ) ; // Process each line. for line in cargo_lock . lines ( ) { // Consider only source entries. if ! line . starts_with ( " " ) { continue ; } // Extract source value. let source = line . split_once ( '=' ) . unwrap ( ) . 1 . trim ( ) ; // Allow all soft-dev repos. // We also allow our personal forks for scenarios where we are breaking a CI cycle and need // to temporarily use one of our personal feature branches. if source . starts_with ( " \" " ) || source . starts_with ( " \" " ) || source . starts_with ( " \" " ) || source . starts_with ( " \" " ) || source . starts_with ( " \" " ) { continue ; } // Ensure source is whitelisted. if ! ALLOWED_SOURCES . contains ( & & * source ) { tidy_error ! ( bad " " source ) ; } } }
Checks for external package sources.
Checks for external package sources .
root
&Path
bad
&mut bool
root
&Path
bad
&mut bool