pub fn apply_exclude_patterns<T, F>(
items: &mut Vec<T>,
patterns: &[String],
get_path: F,
)Expand description
Apply exclude patterns to a collection
Removes items whose paths match any exclude pattern.
Uses a generic get_path function to extract the path from each item.
§Arguments
items- Mutable reference to collection to filterpatterns- List of exclude patternsget_path- Function to extract path from an item
§Type Parameters
T- Type of items in the collectionF- Type of the path extraction function
§Examples
use infiniloom_engine::filtering::apply_exclude_patterns;
use infiniloom_engine::types::RepoFile;
let mut files: Vec<RepoFile> = vec![/* ... */];
let exclude = vec!["node_modules".to_string(), "*.min.js".to_string()];
apply_exclude_patterns(&mut files, &exclude, |f| &f.relative_path);