(v: Vec<String>)
| 1155 | String::from_utf8_lossy(bytes).into_owned() |
| 1156 | } |
| 1157 | |
| 1158 | fn dedup_in_order(v: Vec<String>) -> Vec<String> { |
| 1159 | let mut seen = std::collections::HashSet::new(); |
| 1160 | let mut out = Vec::with_capacity(v.len()); |
| 1161 | for x in v { |
| 1162 | if seen.insert(x.clone()) { |
| 1163 | out.push(x); |
| 1164 | } |
| 1165 | } |
| 1166 | out |
| 1167 | } |
| 1168 | |
| 1169 | /// Line start offsets (byte offset of each line's first byte). |