Skip to content

Commit

Permalink
search *.type if filetype not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
gcxfd committed Feb 24, 2022
1 parent 0b36942 commit a25a07c
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 @@ -339,11 +339,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 a25a07c

Please sign in to comment.