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