Panics · P15 Charts: values within charts::LIMIT; scales, shares and tangents stay finite at the edges; entries past their lists are skipped

This commit is contained in:
ZacharyZhang-NY committed 2026-10-06 19:05:05 -04:00
1 parent 2ea16f4541
commit defbec006e
23 files changed
+483 -95

No files matched your search

+9 -6
View File
@@ -107,12 +107,15 @@ impl GanttChart {
}
/// A task; the ones it waits for come before it.
pub fn task(mut self, task: Task) -> Self {
assert!(
task.after.iter().all(|ix| *ix < self.tasks.len()),
"task {} waits for one not yet given",
task.name
);
pub fn task(mut self, mut task: Task) -> Self {
let known = self.tasks.len();
if task.after.iter().any(|ix| *ix >= known) {
log::error!(
"gantt: task {} waits for one not given; that wait is dropped",
task.name
);
task.after.retain(|ix| *ix < known);
}
self.tasks.push(task);
self
}