Remove unnecessary fields from deserialization
This commit is contained in:
parent
f9f9669446
commit
0dbe7ec080
@ -20,7 +20,6 @@ struct Train {
|
|||||||
number: String,
|
number: String,
|
||||||
//line: String,
|
//line: String,
|
||||||
r#type: String,
|
r#type: String,
|
||||||
admin: String,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
@ -41,7 +40,6 @@ struct Departure {
|
|||||||
route: Vec<Stop>,
|
route: Vec<Stop>,
|
||||||
train: Train,
|
train: Train,
|
||||||
destination: String,
|
destination: String,
|
||||||
initialStopPlace: String,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
@ -251,10 +249,8 @@ async fn route_station_to_dest_station(
|
|||||||
if departure.destination.starts_with(&station_properties.name) {
|
if departure.destination.starts_with(&station_properties.name) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut after_current_station = false;
|
let mut after_current_station = false;
|
||||||
if departure.initialStopPlace == station_properties.code {
|
|
||||||
after_current_station = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut stops_at_destination = false;
|
let mut stops_at_destination = false;
|
||||||
for stop in &departure.route {
|
for stop in &departure.route {
|
||||||
|
Loading…
Reference in New Issue
Block a user