trim strings
This commit is contained in:
parent
cbc17ba85d
commit
744198e66e
2 changed files with 3 additions and 3 deletions
|
@ -383,8 +383,8 @@ pub fn display(timetable: (Vec<String>, (usize, Vec<models::Day>))) {
|
|||
// If the data is too long
|
||||
if course.name.len() > quarter {
|
||||
let data = utils::split_half(&course.name);
|
||||
next_skip.insert(j, data.1);
|
||||
print!("{}{:^cl$}", sep, data.0);
|
||||
next_skip.insert(j, data.1.trim());
|
||||
print!("{}{:^cl$}", sep, data.0.trim());
|
||||
} else {
|
||||
next_skip.insert(j, &course.name);
|
||||
print!("{}{:^cl$}", sep, "");
|
||||
|
|
|
@ -98,5 +98,5 @@ pub fn split_half(text: &str) -> (&str, &str) {
|
|||
|
||||
// Reduce size of string by adding etc. to it, and cutting some info
|
||||
pub fn etc_str(text: &str) -> String {
|
||||
format!("{}...", split_half(text).0)
|
||||
format!("{}...", split_half(text).0.trim())
|
||||
}
|
||||
|
|
Reference in a new issue