// For each file, run rustfmt and collect the output.
// Returns the number of files checked and the number of failures.
For each file, run rustfmt and collect the output.
Returns the number of files checked and the number of failures.
For each file run rustfmt and collect the output . Returns the number of files checked and the number of failures .
fn check_files(files: Vec<PathBuf>, opt_config: &Option<PathBuf>) -> (Vec<FormatReport>, u32, u32) {
    let mut count = 0;
    let mut fails = 0;
    let mut reports = vec![];
    for file_name in files {
        debug!("Testing '{}'...", file_name.display());
        match idempotent_check(&file_name, &opt_config) {
            Ok(ref report) if report.has_warnings() => {
                print!("{}", report);
                fails += 1;
            }
            Ok(report) => reports.push(report),
            Err(err) => {
                if let IdempotentCheckError::Mismatch(msg) = err {
                    print_mismatches_default_message(msg);
                }
                fails += 1;
            }
        }
        count += 1;
    }
    (reports, count, fails)
}
fn check_files ( files : Vec < PathBuf > , opt_config : & Option < PathBuf > ) -> ( Vec < FormatReport > , u32 , u32 ) { let mut count = 0 ; let mut fails = 0 ; let mut reports = vec ! [ ] ; for file_name in files { debug ! ( " " file_name display ( ) ) ; match idempotent_check ( & file_name , & opt_config ) { Ok ( ref report ) if report . has_warnings ( ) => { print ! ( " " report ) ; fails += 1 ; } Ok ( report ) => reports . push ( report ) , Err ( err ) => { if let IdempotentCheckError :: Mismatch ( msg ) = err { print_mismatches_default_message ( msg ) ; } fails += 1 ; } } count += 1 ; } ( reports , count , fails ) }
For each file, run rustfmt and collect the output.
For each file run rustfmt and collect the output .
files
Vec<PathBuf>
opt_config
&Option<PathBuf>