forked from Anri/cal8tor
follow clippy advices
This commit is contained in:
parent
0fb9aededc
commit
f0f38a8031
2 changed files with 6 additions and 9 deletions
|
@ -353,7 +353,7 @@ pub fn display(timetable: (Vec<String>, (usize, Vec<models::Day>)), cell_length:
|
||||||
|
|
||||||
// Print day's of the week
|
// Print day's of the week
|
||||||
let mut days = HashMap::new();
|
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);
|
days.insert(i, &data.name);
|
||||||
print!("{:^cell_length$}{}", &data.name, sep);
|
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);
|
print!("{}{:^clh$}", sep, hour);
|
||||||
|
|
||||||
// For all the days - `j` the day's number
|
// 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
|
// True if we found something about the slot we are looking for
|
||||||
let mut info_slot = false;
|
let mut info_slot = false;
|
||||||
|
|
||||||
// For all the courses of each days - `k` the possible course.start
|
// 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 {
|
match course_opt {
|
||||||
// If there is a course
|
// If there is a course
|
||||||
Some(course) => {
|
Some(course) => {
|
||||||
|
|
|
@ -71,13 +71,10 @@ pub fn line_table(
|
||||||
// Check if it's a big cell
|
// Check if it's a big cell
|
||||||
if i == range - 1 {
|
if i == range - 1 {
|
||||||
// Friday only
|
// Friday only
|
||||||
match skip_with.get(&i) {
|
if let Some(text) = skip_with.get(&i) {
|
||||||
Some(text) => {
|
|
||||||
println!("{:^cell_length$}{}", text, rsbc_bbc);
|
println!("{:^cell_length$}{}", text, rsbc_bbc);
|
||||||
last_day = true;
|
last_day = true;
|
||||||
}
|
}
|
||||||
None => (),
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
match skip_with.get(&i) {
|
match skip_with.get(&i) {
|
||||||
Some(text) => match skip_with.get(&(i + 1)) {
|
Some(text) => match skip_with.get(&(i + 1)) {
|
||||||
|
|
Reference in a new issue