Collect new learnings as heading → items map for merging.
(learnings: &Learnings)
| 498 | |
| 499 | /// Collect new learnings as heading → items map for merging. |
| 500 | fn collect_new_items(learnings: &Learnings) -> HashMap<String, Vec<String>> { |
| 501 | let mut items: HashMap<String, Vec<String>> = HashMap::new(); |
| 502 | |
| 503 | for item in &learnings.repo { |
| 504 | items |
| 505 | .entry("### Repo".to_string()) |
| 506 | .or_default() |
| 507 | .push(format!("- {}", item)); |
| 508 | } |
| 509 | |
| 510 | // Code learnings excluded from context file — they live in change.unhashed |
| 511 | |
| 512 | for item in &learnings.workflow { |
| 513 | items |
| 514 | .entry("### Workflow".to_string()) |
| 515 | .or_default() |
| 516 | .push(format!("- {}", item)); |
| 517 | } |
| 518 | |
| 519 | items |
| 520 | } |
| 521 | |
| 522 | /// Merge new items into existing section headings without duplicating headings. |
| 523 | /// |
no test coverage detected