fn call_cargo() {
    let manifest_path =
        get_arg_flag_value("--manifest-path").map(|m| Path::new(&m).canonicalize().unwrap());

    let mut cmd = cargo_metadata::MetadataCommand::new();
    if let Some(ref manifest_path) = manifest_path {
        cmd.manifest_path(manifest_path);
    }

    let metadata = if let Ok(metadata) = cmd.exec() {
        metadata
    } else {
        eprintln!("Could not obtain Cargo metadata; likely an ill-formed manifest");
        std::process::exit(1);
    };

    if let Some(root) = metadata.root_package() {
        call_cargo_on_each_package_target(root);
        return;
    }

    // There is no root, this must be a workspace, so call_cargo_on_each_package_target on each workspace member
    for package_id in &metadata.workspace_members {
        let package = metadata.index(package_id);
        call_cargo_on_each_package_target(package);
    }
}
/// Read the toml associated with the current directory and
/// recursively execute cargo for each applicable package target/workspace member in the toml
Read the toml associated with the current directory and
recursively execute cargo for each applicable package target/workspace member in the toml
Read the toml associated with the current directory and recursively execute cargo for each applicable package target / workspace member in the toml
fn call_cargo() {
    let manifest_path =
        get_arg_flag_value("--manifest-path").map(|m| Path::new(&m).canonicalize().unwrap());
    let mut cmd = cargo_metadata::MetadataCommand::new();
    if let Some(ref manifest_path) = manifest_path {
        cmd.manifest_path(manifest_path);
    }
    let metadata = if let Ok(metadata) = cmd.exec() {
        metadata
    } else {
        eprintln!("Could not obtain Cargo metadata; likely an ill-formed manifest");
        std::process::exit(1);
    };
    if let Some(root) = metadata.root_package() {
        call_cargo_on_each_package_target(root);
        return;
    }
    // There is no root, this must be a workspace, so call_cargo_on_each_package_target on each workspace member
    for package_id in &metadata.workspace_members {
        let package = metadata.index(package_id);
        call_cargo_on_each_package_target(package);
    }
}
fn call_cargo ( ) { let manifest_path = get_arg_flag_value ( " " ) . map ( | m | Path :: new ( & m ) . canonicalize ( ) . unwrap ( ) ) ; let mut cmd = cargo_metadata :: MetadataCommand :: new ( ) ; if let Some ( ref manifest_path ) = manifest_path { cmd . manifest_path ( manifest_path ) ; } let metadata = if let Ok ( metadata ) = cmd . exec ( ) { metadata } else { eprintln ! ( " " ) ; std :: process :: exit ( 1 ) ; } ; if let Some ( root ) = metadata . root_package ( ) { call_cargo_on_each_package_target ( root ) ; return ; } // There is no root, this must be a workspace, so call_cargo_on_each_package_target on each workspace member for package_id in & metadata . workspace_members { let package = metadata . index ( package_id ) ; call_cargo_on_each_package_target ( package ) ; } }
Read the toml associated with the current directory and
recursively execute cargo for each applicable package target/workspace member in the toml
Read the toml associated with the current directory and recursively execute cargo for each applicable package target / workspace member in the toml