Function cargo_culture_kit::check_culture_default[][src]

pub fn check_culture_default<P: AsRef<Path>, W: Write>(
    cargo_manifest_file_path: P,
    verbose: bool,
    print_output: &mut W
) -> Result<OutcomesByDescription, CheckError>

Execute a check_culture run using the set of rules available from default_rules.

See check_culture for more details.

Examples

use cargo_culture_kit::{check_culture_default, IsSuccess, OutcomeStats};
use std::path::PathBuf;

let cargo_manifest = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
        .join("Cargo.toml");

let verbose = false;

let outcomes = check_culture_default(
                cargo_manifest, verbose, &mut std::io::stdout())
    .expect("Unexpected trouble checking culture rules:");

for (description, outcome) in &outcomes {
    println!(
             "For this project: {} had an outcome of {:?}",
             description, outcome);
}

let stats = OutcomeStats::from(outcomes);
assert!(stats.is_success());
assert_eq!(stats.fail_count, 0);
assert_eq!(stats.undetermined_count, 0);

Errors

Returns an error if the program cannot write to the supplied print_output instance.