diff options
-rw-r--r-- | src/recipe.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/recipe.rs b/src/recipe.rs index d5695f6..18f23fe 100644 --- a/src/recipe.rs +++ b/src/recipe.rs @@ -55,14 +55,12 @@ fn is_yml(path: &Path) -> bool { pub fn read_recipes<P: AsRef<Path>>(path: P) -> Result<TaskMap> { let mut ret = TaskMap::new(); - for entry in WalkDir::new(path) - .into_iter() - .filter_map(|e| e.ok()) - .filter(|e| { - let path = e.path(); - path.is_file() && is_yml(path) - }) { + for entry in WalkDir::new(path).into_iter().filter_map(|e| e.ok()) { let path = entry.path(); + if !path.is_file() || !is_yml(path) { + continue; + } + let basename = match path.file_stem().map(|n| n.to_str()) { Some(Some(v)) => v, _ => continue, |