Check if a learning line is already present in the existing learnings. Compares by the finding text (after the "— ") to handle cases where the line number changed but the finding is the same.
(existing: &[String], new_line: &str)
| 270 | /// Compares by the finding text (after the "— ") to handle cases where |
| 271 | /// the line number changed but the finding is the same. |
| 272 | fn is_duplicate(existing: &[String], new_line: &str) -> bool { |
| 273 | // Extract the finding part (after "— ") for fuzzy matching |
| 274 | let new_finding = extract_finding(new_line); |
| 275 | |
| 276 | existing.iter().any(|existing_line| { |
| 277 | let existing_finding = extract_finding(existing_line); |
| 278 | // Match on finding text, ignoring location differences |
| 279 | !new_finding.is_empty() && new_finding == existing_finding |
| 280 | }) |
| 281 | } |
| 282 | |
| 283 | /// Extract the finding portion from a learning line. |
| 284 | /// |
no test coverage detected