Skip to content

Commit

Permalink
update cargo versions
Browse files Browse the repository at this point in the history
  • Loading branch information
kylerchin committed Nov 2, 2024
1 parent 93c2d67 commit ec724bd
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,8 @@ fn time_and_tz_to_unix(timestamp_text: &String, tz: char) -> i64 {
let local_time_representation = tz_char_to_tz(tz)
.unwrap()
.from_local_datetime(&naive_dt)
.latest().unwrap();
.latest()
.unwrap();

local_time_representation.timestamp().try_into().unwrap()
}
Expand All @@ -510,7 +511,8 @@ pub fn origin_departure(timestamp_text: &str, tz: char) -> chrono::DateTime<chro
tz_char_to_tz(tz)
.unwrap()
.from_local_datetime(&naive_dt)
.latest().unwrap()
.latest()
.unwrap()
}

//time is formatted 11/18/2023 4:58:09 PM
Expand Down Expand Up @@ -663,16 +665,20 @@ mod tests {
}

let raw_data = client
.get("https://maps.amtrak.com/services/MapDataService/trains/getTrainsData")
.send()
.await.unwrap();
.get("https://maps.amtrak.com/services/MapDataService/trains/getTrainsData")
.send()
.await
.unwrap();

let decrypted_string = amtk::decrypt(raw_data.text().await.unwrap().as_str()).unwrap();

let geojson: geojson::GeoJson = decrypted_string.parse::<geojson::GeoJson>().unwrap();
let features_collection: FeatureCollection = FeatureCollection::try_from(geojson).unwrap();

assert_eq!(features_collection.features.len(), amtrak_results.as_ref().unwrap().unified_feed.entity.len());
assert_eq!(
features_collection.features.len(),
amtrak_results.as_ref().unwrap().unified_feed.entity.len()
);

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

0 comments on commit ec724bd

Please sign in to comment.