Archived
1
0
Fork 0
forked from Anri/cal8tor

trim strings

This commit is contained in:
Mylloon 2022-08-23 18:32:06 +02:00
parent cbc17ba85d
commit 744198e66e
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 3 additions and 3 deletions

View file

@ -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, "");

View file

@ -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())
}