files_in_dir_recursive_ending_with

Function files_in_dir_recursive_ending_with 

Source
pub fn files_in_dir_recursive_ending_with<P: AsRef<Path>>(
    source_dir: P,
    ending_with: &str,
) -> Vec<PathBuf>
Expand description

Get all of the files in a directory or any of its subdirectories that end with a given pattern.

We sort the files before returning them in order to ensure consistency for operations that use the files to generate other files.

ยงExamples


// Get all of the files that end in `_view.rs`, such as
// `login_form_view.rs`.
let files = files_in_dir_recursive_ending_with(
    PathBuf::from("/path/to/dir"),
    "_view.rs"
);