(a: &HashSet<(u8, u8)>, b: &HashSet<(u8, u8)>)
| 1110 | } |
| 1111 | |
| 1112 | fn jaccard(a: &HashSet<(u8, u8)>, b: &HashSet<(u8, u8)>) -> f64 { |
| 1113 | if a.is_empty() && b.is_empty() { |
| 1114 | return 0.0; |
| 1115 | } |
| 1116 | let inter = a.intersection(b).count(); |
| 1117 | let union = a.union(b).count(); |
| 1118 | if union == 0 { |
| 1119 | 0.0 |
| 1120 | } else { |
| 1121 | inter as f64 / union as f64 |
| 1122 | } |
| 1123 | } |
| 1124 | |
| 1125 | // 1. Collect all Removed and Added lines with their original indices |
| 1126 | let mut rm_entries: Vec<(usize, &HunkLine)> = Vec::new(); |
no test coverage detected