Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] [kv12ntfs] Skip routes (and lines) if no vj above (instead of fail process) #410

Merged
merged 1 commit into from
Oct 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/kv1/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ fn make_routes(collections: &mut Collections, jopas: &[Jopa]) -> Result<()> {
.collect();
for ((line_id, direction), jopa) in jopas_map {
let id = jopa.route_id();
let (origin, destination) = get_route_origin_destination(collections, &id)?;
let (origin, destination) = skip_fail!(get_route_origin_destination(collections, &id));
let name = format!("{} - {}", origin.name, destination.name);
let destination_stop_area = collections
.stop_areas
Expand Down Expand Up @@ -763,9 +763,9 @@ fn make_lines(collections: &mut Collections, lines: &CollectionWithId<Kv1Line>)
.filter(|r| r.line_id == l.id)
.collect();
let backward_route = route_name_by_direction(&corresponding_routes, "backward");
let forward_route = route_name_by_direction(&corresponding_routes, "forward")
let forward_route = skip_fail!(route_name_by_direction(&corresponding_routes, "forward")
.or(backward_route)
.ok_or_else(|| format_err!("no routes found with line_id={}", l.id,))?;
.ok_or_else(|| format_err!("no routes found with line_id={}", l.id,)));

collections
.lines
Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/kv12ntfs/input/JOPAXXXXXX.TMI
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ JOPA|1|I|SYNTUS|2029|90016|SRVC|2|
JOPA|1|I|SYNTUS|2029|90049|SRVC|1|
JOPA|1|I|SYNTUS|2030|00011|SRVC|1|
JOPA|1|I|SYNTUS|3170|0001|SRVC|1|
JOPA|1|I|SYNTUS|6736|6001|SRVC|2|
1 change: 1 addition & 0 deletions tests/fixtures/kv12ntfs/input/LINEXXXXXX.TMI
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
LINE|1|I|SYNTUS|2029|29|29|0|MO Lijn_2029|BUS||
LINE|1|I|SYNTUS|2030|30|30|0|MO Lijn_2030|BUS||
LINE|1|I|SYNTUS|3170|170|170|0|VE Lijn_3170|METRO||
LINE|1|I|SYNTUS|6736|M36|M36|0|AL Lijn_6736|BUS||