mirror of
https://github.com/n08i40k/schedule-parser-rusted.git
synced 2025-12-06 09:47:50 +03:00
Добавлена конвертация расписания групп в расписание преподавателей
This commit is contained in:
12
src/main.rs
12
src/main.rs
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user