diff options
Diffstat (limited to '')
-rw-r--r-- | src/travelynx.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/travelynx.rs b/src/travelynx.rs index c5351eb..c3318ab 100644 --- a/src/travelynx.rs +++ b/src/travelynx.rs @@ -2,7 +2,7 @@ use clap::Args; use colored::*; use serde::{Deserialize, Serialize}; -use crate::types::Status; +use crate::types::{Status, Train}; #[derive(Serialize)] #[serde(rename_all = "camelCase")] @@ -56,6 +56,15 @@ impl std::fmt::Display for TrainRef { } } +impl std::convert::From<Train> for TrainRef { + fn from(from: Train) -> Self { + TrainRef { + _type: from._type, + no: from.no + } + } +} + #[derive(Deserialize, Debug)] pub struct Response { success: Option<bool>, |