Skip to content

Commit

Permalink
Merge pull request #1 from gcxfd/master
Browse files Browse the repository at this point in the history
search *.type if filetype not exist
  • Loading branch information
usrtax authored Aug 8, 2022
2 parents 3bb71b0 + a25a07c commit 6671a7a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions crates/ignore/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,14 @@ impl TypesBuilder {
let mut glob_to_selection = vec![];
let mut build_set = GlobSetBuilder::new();
for (isel, selection) in self.selections.iter().enumerate() {
let def = match self.types.get(selection.name()) {
let name = selection.name().to_string();
let def = match self.types.get(&name) {
Some(def) => def.clone(),
None => {
let name = selection.name().to_string();
return Err(Error::UnrecognizedFileType(name));
FileTypeDef {
globs:vec![format!("*.{name}")],
name,
}
}
};
for (iglob, glob) in def.globs.iter().enumerate() {
Expand Down

0 comments on commit 6671a7a

Please sign in to comment.