Archived
1
0
Fork 0
forked from Anri/cal8tor

follow clippy advices

This commit is contained in:
Mylloon 2023-01-10 11:53:19 +01:00
parent 0fb9aededc
commit f0f38a8031
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 6 additions and 9 deletions

View file

@ -353,7 +353,7 @@ pub fn display(timetable: (Vec<String>, (usize, Vec<models::Day>)), cell_length:
// Print day's of the week
let mut days = HashMap::new();
for (i, data) in (&timetable.1 .1).iter().enumerate() {
for (i, data) in timetable.1 .1.iter().enumerate() {
days.insert(i, &data.name);
print!("{:^cell_length$}{}", &data.name, sep);
}
@ -372,12 +372,12 @@ pub fn display(timetable: (Vec<String>, (usize, Vec<models::Day>)), cell_length:
print!("{}{:^clh$}", sep, hour);
// For all the days - `j` the day's number
for (j, day) in (&timetable.1 .1).iter().enumerate() {
for (j, day) in timetable.1 .1.iter().enumerate() {
// True if we found something about the slot we are looking for
let mut info_slot = false;
// For all the courses of each days - `k` the possible course.start
for (k, course_opt) in (&day.courses).iter().enumerate() {
for (k, course_opt) in day.courses.iter().enumerate() {
match course_opt {
// If there is a course
Some(course) => {

View file

@ -71,12 +71,9 @@ pub fn line_table(
// Check if it's a big cell
if i == range - 1 {
// Friday only
match skip_with.get(&i) {
Some(text) => {
println!("{:^cell_length$}{}", text, rsbc_bbc);
last_day = true;
}
None => (),
if let Some(text) = skip_with.get(&i) {
println!("{:^cell_length$}{}", text, rsbc_bbc);
last_day = true;
}
} else {
match skip_with.get(&i) {