pub fn fix_container_dependencies(project: &mut Project) -> usizeExpand description
Fix container dependency issues (W014) by propagating container dependencies to children.
This function modifies the project in-place, adding missing dependencies to child tasks when their container has dependencies but the children don’t have matching ones.
Returns the number of dependencies added.
§Example
use utf8proj_core::{Project, Task, Duration};
use utf8proj_solver::fix_container_dependencies;
let mut project = Project::new("Test");
// Create a container with a dependency
let mut container = Task::new("container");
container.depends.push(utf8proj_core::Dependency {
predecessor: "predecessor".to_string(),
dep_type: utf8proj_core::DependencyType::FinishToStart,
lag: None,
});
// Child without the dependency
container.children.push(Task::new("child").effort(Duration::days(3)));
project.tasks.push(Task::new("predecessor").effort(Duration::days(5)));
project.tasks.push(container);
// Fix the issue
let fixed_count = fix_container_dependencies(&mut project);
assert_eq!(fixed_count, 1);