fn are_input_files_supported(args: &Args, config: &Config) -> bool {
    let paths = vec![&args.old, &args.new];

    // If there's a user override at the command line, that takes priority over everything else.
    if let Some(file_type) = &args.file_type {
        return generate_language(file_type, &config.grammar).is_ok();
    }

    // For each path, attempt to create a parser for that given extension, checking for any
    // possible overrides.
    for path in paths.into_iter().flatten() {
        debug!("Checking if {} can be parsed", path.display());
        let ext = path.extension();

        if ext.is_none() {
            return false;
        }

        let ext = ext.unwrap();

        if ext.to_str().is_none() {
            warn!("No filetype deduced for {}", path.display());
            return false;
        }

        let ext = ext.to_str().unwrap();

        if language_from_ext(ext, &config.grammar).is_err() {
            error!("Extension {} not supported", ext);
            return false;
        }
    }
    debug!("Extensions for both input files are supported");
    true
}
/// Check if the input files are supported by this program.
///
/// If the user provides a language override, this will check that the language is supported by the
/// program. If the user supplies any extension mappings, this will check to see if the extension
/// is in the mapping or if it's one of the user-defined ones.
///
/// This is used to determine whether the program should fall back to another diff utility.
Check if the input files are supported by this program.
If the user provides a language override, this will check that the language is supported by the
program. If the user supplies any extension mappings, this will check to see if the extension
is in the mapping or if it's one of the user-defined ones.

This is used to determine whether the program should fall back to another diff utility.
Check if the input files are supported by this program . If the user provides a language override this will check that the language is supported by the program . If the user supplies any extension mappings this will check to see if the extension is in the mapping or if it ' s one of the user - defined ones . This is used to determine whether the program should fall back to another diff utility .
fn are_input_files_supported(args: &Args, config: &Config) -> bool {
    let paths = vec![&args.old, &args.new];
    // If there's a user override at the command line, that takes priority over everything else.
    if let Some(file_type) = &args.file_type {
        return generate_language(file_type, &config.grammar).is_ok();
    }
    // For each path, attempt to create a parser for that given extension, checking for any
    // possible overrides.
    for path in paths.into_iter().flatten() {
        debug!("Checking if {} can be parsed", path.display());
        let ext = path.extension();
        if ext.is_none() {
            return false;
        }
        let ext = ext.unwrap();
        if ext.to_str().is_none() {
            warn!("No filetype deduced for {}", path.display());
            return false;
        }
        let ext = ext.to_str().unwrap();
        if language_from_ext(ext, &config.grammar).is_err() {
            error!("Extension {} not supported", ext);
            return false;
        }
    }
    debug!("Extensions for both input files are supported");
    true
}
fn are_input_files_supported ( args : & Args , config : & Config ) -> bool { let paths = vec ! [ args old args new ] ; // If there's a user override at the command line, that takes priority over everything else. if let Some ( file_type ) = & args . file_type { return generate_language ( file_type , & config . grammar ) . is_ok ( ) ; } // For each path, attempt to create a parser for that given extension, checking for any // possible overrides. for path in paths . into_iter ( ) . flatten ( ) { debug ! ( " " path display ( ) ) ; let ext = path . extension ( ) ; if ext . is_none ( ) { return false ; } let ext = ext . unwrap ( ) ; if ext . to_str ( ) . is_none ( ) { warn ! ( " " path display ( ) ) ; return false ; } let ext = ext . to_str ( ) . unwrap ( ) ; if language_from_ext ( ext , & config . grammar ) . is_err ( ) { error ! ( " " ext ) ; return false ; } } debug ! ( " " ) ; true }
Check if the input files are supported by this program.
Check if the input files are supported by this program .
args
&Args
config
&Config
args
&Args
config
&Config