From 4a2a3848e667ac9e1a255b1e131df18868932810 Mon Sep 17 00:00:00 2001 From: structix Date: Sun, 22 Sep 2024 21:06:10 +0200 Subject: [PATCH] =?UTF-8?q?Breaking=20change:=20replace=20Mensa=20Shedhall?= =?UTF-8?q?e=20with=20Mensa=20Wilhemstra=C3=9Fe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cli.rs | 4 ++-- src/main.rs | 4 ++-- src/mensa.rs | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index 74b695f..200128d 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -8,9 +8,9 @@ pub struct Args { #[arg(short, long, default_value_t = false)] pub morgenstelle: bool, - /// Show Mensa Shedhalle + /// Show Mensa Wilhelmstraße #[arg(short, long, default_value_t = false)] - pub shedhalle: bool, + pub wilhelmstrasse: bool, /// Show Mensa Prinz Karl #[arg(short, long, default_value_t = false)] diff --git a/src/main.rs b/src/main.rs index 2b859d1..f3bc14e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,8 +16,8 @@ fn exec_arguments(args: &cli::Args) { } } - if args.shedhalle { - if let Ok(resp) = Mensa::from(MensaName::Shedhalle) { + if args.wilhelmstrasse { + if let Ok(resp) = Mensa::from(MensaName::Wilhelmstrasse) { exec_arg_helper(args, &resp); } } diff --git a/src/mensa.rs b/src/mensa.rs index c85aace..bbf5e29 100644 --- a/src/mensa.rs +++ b/src/mensa.rs @@ -5,7 +5,7 @@ use std::time::Duration; use ureq::{Agent, Error}; pub enum MensaName { - Shedhalle, + Wilhelmstrasse, Morgenstelle, PrinzKarl, } @@ -36,7 +36,7 @@ fn get_nth_date(days: u8) -> Option> { pub struct Mensa { #[serde(alias = "621")] // Morgenstelle #[serde(alias = "623")] // Prinz Karl - #[serde(rename = "611")] // Shedhalle + #[serde(rename = "611")] // Wilhelmstraße canteen: Canteen, } @@ -48,7 +48,7 @@ impl Mensa { .build(); let canteen_id = match name { - MensaName::Shedhalle => 611, + MensaName::Wilhelmstrasse => 611, MensaName::Morgenstelle => 621, MensaName::PrinzKarl => 623, }; @@ -70,7 +70,7 @@ impl Mealplan for Mensa { } fn name(&self) -> &str { - &&self.canteen.canteen + &self.canteen.canteen } fn today(&self) -> (String, Vec<&Menu>) {