From ac6dbcf54cf1b58aba0d6943fd1a39a0c4c2b23f Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 23 Aug 2022 10:28:30 +0200 Subject: [PATCH] print separator --- src/main.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 54fa679..9ef8017 100644 --- a/src/main.rs +++ b/src/main.rs @@ -41,9 +41,16 @@ async fn main() { .name("letter") .map(|c| c.as_str().chars().next().expect("Error in letter")); + // Show a separator only if we need one + let seperator = match letter { + Some(_) => "-", + None => "", + }; + println!( - "Fetch the timetable for L{}{}...", + "Fetch the timetable for L{}{}{}...", year, + seperator, letter.unwrap_or_default() ); let timetable = timetable::timetable(year, args.semester, letter).await;