vibes
This commit is contained in:
parent
80c093b7ba
commit
f72c43a9fa
101 changed files with 2168 additions and 1177 deletions
|
|
@ -124,10 +124,7 @@ impl TravelTimeStore {
|
|||
if file_name.ends_with(".parquet") {
|
||||
let file_stem = file_name.trim_end_matches(".parquet");
|
||||
let slug = strip_numeric_prefix(file_stem).to_string();
|
||||
slug_to_file.insert(
|
||||
(mode.clone(), slug.clone()),
|
||||
file_stem.to_string(),
|
||||
);
|
||||
slug_to_file.insert((mode.clone(), slug.clone()), file_stem.to_string());
|
||||
slugs.insert(slug);
|
||||
}
|
||||
}
|
||||
|
|
@ -207,10 +204,7 @@ impl TravelTimeStore {
|
|||
for (i, (pc, min)) in postcodes.into_iter().zip(minutes.into_iter()).enumerate() {
|
||||
if let (Some(pc), Some(min)) = (pc, min) {
|
||||
let best_min = best.as_ref().and_then(|b| b.get(i));
|
||||
let journey = journeys
|
||||
.as_ref()
|
||||
.and_then(|j| j.get(i))
|
||||
.map(Arc::from);
|
||||
let journey = journeys.as_ref().and_then(|j| j.get(i)).map(Arc::from);
|
||||
map.insert(
|
||||
pc.to_string(),
|
||||
TravelDataRow {
|
||||
|
|
@ -274,10 +268,15 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn strip_numeric_prefix_basic() {
|
||||
assert_eq!(strip_numeric_prefix("000000-bank-tube-station"), "bank-tube-station");
|
||||
assert_eq!(
|
||||
strip_numeric_prefix("000000-bank-tube-station"),
|
||||
"bank-tube-station"
|
||||
);
|
||||
assert_eq!(strip_numeric_prefix("000123-abbey-hey"), "abbey-hey");
|
||||
assert_eq!(strip_numeric_prefix("bank-tube-station"), "bank-tube-station");
|
||||
assert_eq!(
|
||||
strip_numeric_prefix("bank-tube-station"),
|
||||
"bank-tube-station"
|
||||
);
|
||||
assert_eq!(strip_numeric_prefix("london"), "london");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue