diff options
Diffstat (limited to '')
-rw-r--r-- | src/onboard/iceportal.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/onboard/iceportal.rs b/src/onboard/iceportal.rs index bc97261..bde0b1f 100644 --- a/src/onboard/iceportal.rs +++ b/src/onboard/iceportal.rs @@ -8,12 +8,14 @@ use crate::onboard; use crate::onboard::{OnBoardAPI, OnBoardInfo}; use crate::{serde::*, traits::*, travelynx::TrainRef}; +use crate::types::Trip; + pub struct Iceportal {} #[derive(Deserialize, Debug)] #[serde(rename_all = "camelCase")] pub struct TripInfo { - trip: Trip, + trip: IceTrip, connection: Option<Value>, selected_route: Option<Value>, active: Option<Value> @@ -21,7 +23,7 @@ pub struct TripInfo { #[derive(Deserialize, Debug)] #[serde(rename_all = "camelCase")] -struct Trip { +struct IceTrip { train_type: String, vzn: String, // train number // some position info here @@ -100,10 +102,8 @@ impl OnBoardInfo for TripInfo { } } - fn stops<'a>( - &'a self - ) -> Box<dyn std::iter::Iterator<Item = &'a dyn IsStation> + 'a> { - Box::new(self.trip.stops.iter().map(|s| s as &dyn IsStation)) + fn stops<'a>(&'a self) -> Trip<'a> { + (&self.trip.stops).into() } } |