Skip to content

Commit

Permalink
feat: print find schedule result with tabular format
Browse files Browse the repository at this point in the history
  • Loading branch information
albugowy15 committed Aug 13, 2024
1 parent f6e7895 commit e10cdec
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/commands/find.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@ pub async fn find_handler(file: &PathBuf, sheet: &str, subject: &str) -> anyhow:
let excel = Excel::new(file, sheet)?;

let class_schedule = excel.find_schedule_from_class(subject);
println!(
"{0: <60} | {1: <35} | {2: <10} | {3: <10}",
"class", "lecturer codes", "day", "session"
);
for schedule in class_schedule.into_iter() {
println!(
"class:{}, lec_codes:{:?}, day: {}, session:{}",
schedule.class, schedule.lecturers_code, schedule.day, schedule.session_start
"{0: <60} | {1: <35} | {2: <10} | {3: <10}",
schedule.class,
format!("{:?}", schedule.lecturers_code),
schedule.day,
schedule.session_start
);
}
Ok(())
Expand Down

0 comments on commit e10cdec

Please sign in to comment.