Deserialize field into proper rust naming convention
This commit is contained in:
parent
0dbe7ec080
commit
83b28fb580
@ -36,7 +36,8 @@ struct DepartureInfo {
|
|||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
struct Departure {
|
struct Departure {
|
||||||
departure: Option<DepartureInfo>,
|
departure: Option<DepartureInfo>,
|
||||||
initialDeparture: String,
|
#[serde(rename = "initialDeparture")]
|
||||||
|
initial_departure: String,
|
||||||
route: Vec<Stop>,
|
route: Vec<Stop>,
|
||||||
train: Train,
|
train: Train,
|
||||||
destination: String,
|
destination: String,
|
||||||
@ -273,7 +274,7 @@ async fn route_station_to_dest_station(
|
|||||||
|
|
||||||
if stops_at_destination {
|
if stops_at_destination {
|
||||||
out.push_str(&format!("<li><time datetime=\"{}\">{}</time>: ", departure_info.time, departure_time.format("%H:%M")));
|
out.push_str(&format!("<li><time datetime=\"{}\">{}</time>: ", departure_info.time, departure_time.format("%H:%M")));
|
||||||
out.push_str(&format!("<a href=\"https://bahn.expert/details/{}%20{}/{}?evaNumberAlongRoute={}\">", &departure.train.r#type, &departure.train.number, &departure.initialDeparture, station_properties.code));
|
out.push_str(&format!("<a href=\"https://bahn.expert/details/{}%20{}/{}?evaNumberAlongRoute={}\">", &departure.train.r#type, &departure.train.number, &departure.initial_departure, station_properties.code));
|
||||||
out.push_str(&format!("{} ({} {})</a>", &departure.train.name, &departure.train.r#type, &departure.train.number));
|
out.push_str(&format!("{} ({} {})</a>", &departure.train.name, &departure.train.r#type, &departure.train.number));
|
||||||
out.push_str(&format!("[{}]-> {}\n", departure_info.platform, &departure.destination));
|
out.push_str(&format!("[{}]-> {}\n", departure_info.platform, &departure.destination));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user