(v: Vec<String>)
| 1127 | String::from_utf8_lossy(bytes).into_owned() |
| 1128 | } |
| 1129 | |
| 1130 | fn dedup_in_order(v: Vec<String>) -> Vec<String> { |
| 1131 | let mut seen = std::collections::HashSet::new(); |
| 1132 | let mut out = Vec::with_capacity(v.len()); |
| 1133 | for x in v { |
| 1134 | if seen.insert(x.clone()) { |
| 1135 | out.push(x); |
| 1136 | } |
| 1137 | } |
| 1138 | out |
| 1139 | } |
| 1140 | |
| 1141 | /// Line start offsets (byte offset of each line's first byte). |