Skip to content

Commit

Permalink
make scharr and schdep optional
Browse files Browse the repository at this point in the history
  • Loading branch information
kylerchin committed Oct 6, 2024
1 parent a78f005 commit 34bca10
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ pub struct GtfsAmtrakResultsJoined {
pub unified_feed: FeedMessage,
}

#[derive(serde::Deserialize)]
#[derive(serde::Deserialize, Debug)]
pub struct AmtrakArrivalJson {
//{"code":"CTL",
code: String,
Expand All @@ -106,9 +106,9 @@ pub struct AmtrakArrivalJson {
//"bus":false,
bus: bool,
// "scharr":"12/11/2023 17:33:00",
scharr: String,
scharr: Option<String>,
// "schdep":"12/11/2023 17:36:00",
schdep: String,
schdep: Option<String>,
// "schcmnt":"",
schcmnt: String,
//"autoarr":true,
Expand Down Expand Up @@ -143,6 +143,8 @@ fn feature_to_amtrak_arrival_structs(feature: &geojson::Feature) -> Vec<AmtrakAr

if amtrak_arrival.is_ok() {
amtrak_arrival_jsons.push(amtrak_arrival.unwrap());
} else {
println!("Error parsing amtrak arrival json, {}\n{}", station_text, amtrak_arrival.unwrap_err());
}
}
_ => {}
Expand Down Expand Up @@ -612,7 +614,7 @@ mod tests {
assert!(amtrak_results.is_ok());

for entity in amtrak_results.unwrap().unified_feed.entity {
println!("{:?}", entity.trip_update);
//println!("{:?}", entity.trip_update);
}

// println!("{:?}", amtrak_results.unwrap());
Expand Down

0 comments on commit 34bca10

Please sign in to comment.