forked from Anri/cal8tor
fix #7
This commit is contained in:
parent
fb21d3eece
commit
344b018936
1 changed files with 28 additions and 13 deletions
41
src/utils.rs
41
src/utils.rs
|
@ -65,22 +65,37 @@ pub fn line_table(
|
||||||
};
|
};
|
||||||
|
|
||||||
// Courses columns
|
// Courses columns
|
||||||
for i in 0..number_cell - 2 {
|
let range = number_cell - 1;
|
||||||
|
let mut last_day = false;
|
||||||
|
for i in 0..range {
|
||||||
// Check if it's a big cell
|
// Check if it's a big cell
|
||||||
match skip_with.get(&i) {
|
if i == range - 1 {
|
||||||
Some(text) => match skip_with.get(&(i + 1)) {
|
// Friday only
|
||||||
// Match check if the next cell will be big
|
match skip_with.get(&i) {
|
||||||
Some(_) => print!("{:^cell_length$}{}", text, rsbc_bbc),
|
Some(text) => {
|
||||||
None => print!("{:^cell_length$}{}", text, rsbc),
|
println!("{:^cell_length$}{}", text, rsbc_bbc);
|
||||||
},
|
last_day = true;
|
||||||
None => match skip_with.get(&(i + 1)) {
|
},
|
||||||
// Match check if the next cell will be big
|
None => (),
|
||||||
Some(_) => print!("{}{}", line, rs_bbc),
|
}
|
||||||
None => print!("{}{}", line, ms),
|
} else {
|
||||||
},
|
match skip_with.get(&i) {
|
||||||
|
Some(text) => match skip_with.get(&(i + 1)) {
|
||||||
|
// Match check if the next cell will be big
|
||||||
|
Some(_) => print!("{:^cell_length$}{}", text, rsbc_bbc),
|
||||||
|
None => print!("{:^cell_length$}{}", text, rsbc),
|
||||||
|
},
|
||||||
|
None => match skip_with.get(&(i + 1)) {
|
||||||
|
// Match check if the next cell will be big
|
||||||
|
Some(_) => print!("{}{}", line, rs_bbc),
|
||||||
|
None => print!("{}{}", line, ms),
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
println!("{}{}", line, rs);
|
if !last_day {
|
||||||
|
println!("{}{}", line, rs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Split a string in half with respect of words
|
// Split a string in half with respect of words
|
||||||
|
|
Loading…
Reference in a new issue