diff options
Diffstat (limited to 'crates/driver/src/recipe.rs')
-rw-r--r-- | crates/driver/src/recipe.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/driver/src/recipe.rs b/crates/driver/src/recipe.rs index 745e2f6..277a393 100644 --- a/crates/driver/src/recipe.rs +++ b/crates/driver/src/recipe.rs @@ -51,8 +51,8 @@ fn is_yml(path: &Path) -> bool { path.extension() == Some("yml".as_ref()) } -pub fn read_recipes<P: AsRef<Path>>(path: P) -> Result<HashMap<TaskID, TaskDef>> { - let mut tasks = HashMap::new(); +pub fn read_recipes<P: AsRef<Path>>(path: P) -> Result<HashMap<TaskID, Vec<TaskDef>>> { + let mut tasks = HashMap::<TaskID, Vec<TaskDef>>::new(); for entry in WalkDir::new(path).into_iter().filter_map(|e| e.ok()) { let path = entry.path(); @@ -85,7 +85,7 @@ pub fn read_recipes<P: AsRef<Path>>(path: P) -> Result<HashMap<TaskID, TaskDef>> task: label, }; task.meta = meta.clone(); - tasks.insert(task_id, task); + tasks.entry(task_id).or_default().push(task); } } |