(v: Vec<String>)
| 1145 | String::from_utf8_lossy(bytes).into_owned() |
| 1146 | } |
| 1147 | |
| 1148 | fn dedup_in_order(v: Vec<String>) -> Vec<String> { |
| 1149 | let mut seen = std::collections::HashSet::new(); |
| 1150 | let mut out = Vec::with_capacity(v.len()); |
| 1151 | for x in v { |
| 1152 | if seen.insert(x.clone()) { |
| 1153 | out.push(x); |
| 1154 | } |
| 1155 | } |
| 1156 | out |
| 1157 | } |
| 1158 | |
| 1159 | /// Line start offsets (byte offset of each line's first byte). |