Добавлена конвертация расписания групп в расписание преподавателей

This commit is contained in:
2025-03-21 20:54:52 +04:00
parent 436d08a56a
commit b508db693e
7 changed files with 114 additions and 20 deletions

View File

@@ -3,13 +3,21 @@ use std::path::Path;
use schedule_parser::parse_xls;
fn main() {
let groups = parse_xls(Path::new("./schedule.xls"));
let (teachers, groups) = parse_xls(Path::new("./schedule.xls"));
fs::write(
"./schedule.json",
serde_json::to_string_pretty(&groups)
.expect("Failed to serialize schedule!")
.expect("Failed to serialize schedule")
.as_bytes(),
)
.expect("Failed to write schedule");
fs::write(
"./teachers.json",
serde_json::to_string_pretty(&teachers)
.expect("Failed to serialize teachers schedule")
.as_bytes(),
)
.expect("Failed to write teachers schedule");
}