summaryrefslogtreecommitdiff
path: root/src/traits.rs
diff options
context:
space:
mode:
authorstuebinm2024-09-09 15:47:47 +0200
committerstuebinm2024-09-09 15:47:47 +0200
commit0a3aad3a4e31049b36832827a5b3afff1334bff8 (patch)
treec8235aaae7a8ee564741161ab0d9fd1fb8b3c81c /src/traits.rs
parentb6080abc5661f9323593944f5701d7dd7597afb9 (diff)
do not require ds100 codes in API responsesHEADmain
these are not present when other hafas backends than the DB one were used for the trip's checkin.
Diffstat (limited to '')
-rw-r--r--src/traits.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/traits.rs b/src/traits.rs
index 091709a..b4b74e7 100644
--- a/src/traits.rs
+++ b/src/traits.rs
@@ -6,7 +6,7 @@ pub trait IsStation {
fn name(&self) -> &str;
fn scheduled_arrival(&self) -> Option<&DateTime<Utc>>;
fn real_arrival(&self) -> Option<&DateTime<Utc>>;
- fn ds100(&self) -> &str;
+ fn ds100(&self) -> Option<&str>;
fn to_fancy_string(&self) -> String {
// travelynx literally sends this entire precise date in case of an
@@ -35,7 +35,7 @@ pub trait IsStation {
text.green()
}
},
- self.ds100().red(),
+ self.ds100().unwrap_or("??").red(),
self.name()
)
}