From cae7b9b99b8323e6996097aa57dcacefd03b87b2 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 18 May 2024 15:21:14 +0200 Subject: [PATCH] add default language --- src/iotro.rs | 6 ++++++ src/main.rs | 1 + 2 files changed, 7 insertions(+) diff --git a/src/iotro.rs b/src/iotro.rs index 683eb10..4f98798 100644 --- a/src/iotro.rs +++ b/src/iotro.rs @@ -94,6 +94,12 @@ pub const BRITISH: Language<'static> = Language { questions_feedback: "Questions, Suggestions and Feedback" }; +impl Default for Language<'static> { + fn default() -> Self { + GERMAN + } +} + impl FromStr for Language<'static> { type Err = anyhow::Error; diff --git a/src/main.rs b/src/main.rs index 1e46727..048fa36 100644 --- a/src/main.rs +++ b/src/main.rs @@ -154,6 +154,7 @@ struct ProjectLecture { docent: String, #[serde_as(as = "DisplayFromStr")] date: Date, + #[serde(default = "Default::default")] #[serde_as(as = "DisplayFromStr")] lang: Language<'static> }