changes to list command line options

This commit is contained in:
aaron-jack-manning
2022-08-29 17:34:22 +10:00
parent 083d276252
commit c547fb8997
16 changed files with 224 additions and 160 deletions

13
src/graph.rs Normal file → Executable file
View File

@@ -71,6 +71,19 @@ impl Graph {
}
}
/// Gets all tasks which have dependents.
pub fn get_tasks_with_dependents(&self) -> HashSet<Id> {
let mut tasks_with_dependents = HashSet::new();
for (_, outgoing) in &self.edges {
for edge in outgoing {
tasks_with_dependents.insert(*edge);
}
}
tasks_with_dependents
}
pub fn find_cycle(&self) -> Option<Vec<Id>> {
// All unvisited nodes, populated with all nodes at the start, to not miss disconnected