diff --git a/src/api/mod.rs b/src/api/mod.rs index 62348ec..382c594 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -211,10 +211,10 @@ pub async fn get_class(Query(params): Query) -> impl IntoRes } pub fn get_header(record: &StringRecord, header: Option
) -> Header { - let mut docente: Option = None; + let mut teacher: Option = None; let mut weekdays = HashMap::new(); if let Some(h) = header { - docente = h.teacher; + teacher = h.teacher; weekdays = h.weekdays; } @@ -228,7 +228,7 @@ pub fn get_header(record: &StringRecord, header: Option
) -> Header { let field = field.replace(" ", "").to_uppercase(); if field == "DOCENTE" { - docente = Some(i as u8); + teacher = Some(i as u8); } else if field.starts_with("LUN") { weekdays.insert("Lunedì".to_string(), i..next_index + i + 1); } else if field.starts_with("MAR") { @@ -244,10 +244,7 @@ pub fn get_header(record: &StringRecord, header: Option
) -> Header { } } - Header { - teacher: docente, - weekdays, - } + Header { teacher, weekdays } } pub fn get_header_wrapper(rdr: &mut Reader<&[u8]>) -> Header {