print separator

This commit is contained in:
Mylloon 2022-08-23 10:28:30 +02:00
parent 7e5461ed81
commit ac6dbcf54c
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -41,9 +41,16 @@ async fn main() {
.name("letter") .name("letter")
.map(|c| c.as_str().chars().next().expect("Error in 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!( println!(
"Fetch the timetable for L{}{}...", "Fetch the timetable for L{}{}{}...",
year, year,
seperator,
letter.unwrap_or_default() letter.unwrap_or_default()
); );
let timetable = timetable::timetable(year, args.semester, letter).await; let timetable = timetable::timetable(year, args.semester, letter).await;