From 0a3aad3a4e31049b36832827a5b3afff1334bff8 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Mon, 9 Sep 2024 15:47:47 +0200 Subject: 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. --- src/traits.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/traits.rs') 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>; fn real_arrival(&self) -> Option<&DateTime>; - 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() ) } -- cgit v1.2.3