diff options
author | stuebinm | 2024-09-09 15:47:47 +0200 |
---|---|---|
committer | stuebinm | 2024-09-09 15:47:47 +0200 |
commit | 0a3aad3a4e31049b36832827a5b3afff1334bff8 (patch) | |
tree | c8235aaae7a8ee564741161ab0d9fd1fb8b3c81c /src/traits.rs | |
parent | b6080abc5661f9323593944f5701d7dd7597afb9 (diff) |
do not require ds100 codes in API responses
these are not present when other hafas backends than the DB one were
used for the trip's checkin.
Diffstat (limited to 'src/traits.rs')
-rw-r--r-- | src/traits.rs | 4 |
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() ) } |