aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/utils
diff options
context:
space:
mode:
authordenis <denismaximov98@gmail.com>2021-04-22 11:45:29 +0300
committerdenis <denismaximov98@gmail.com>2021-04-22 11:45:29 +0300
commit8d98ca7da0bc278a832e4e7de23ff63a84deb529 (patch)
treee7fdfaa6c1ae25e7737dbb36bd1dbcb94d62ab47 /src/common/utils
parentwip: fixing the first arrow (diff)
parentfix(cargo): reduce crate size by 4.8MB using `cargo diet`, to 77kB (diff)
downloadsl0ppij-8d98ca7da0bc278a832e4e7de23ff63a84deb529.tar.gz
sl0ppij-8d98ca7da0bc278a832e4e7de23ff63a84deb529.tar.xz
sl0ppij-8d98ca7da0bc278a832e4e7de23ff63a84deb529.zip
wip: merge main in
Diffstat (limited to 'src/common/utils')
-rw-r--r--src/common/utils/logging.rs6
-rw-r--r--src/common/utils/shared.rs4
2 files changed, 4 insertions, 6 deletions
diff --git a/src/common/utils/logging.rs b/src/common/utils/logging.rs
index d08639aa..06827bfc 100644
--- a/src/common/utils/logging.rs
+++ b/src/common/utils/logging.rs
@@ -47,8 +47,7 @@ pub fn _debug_log_to_file_pid_3(message: String, pid: RawFd) -> io::Result<()> {
}
}
-#[allow(dead_code)]
-pub fn delete_log_file() -> io::Result<()> {
+pub fn _delete_log_file() -> io::Result<()> {
if fs::metadata(ZELLIJ_TMP_LOG_FILE).is_ok() {
fs::remove_file(ZELLIJ_TMP_LOG_FILE)
} else {
@@ -56,8 +55,7 @@ pub fn delete_log_file() -> io::Result<()> {
}
}
-#[allow(dead_code)]
-pub fn delete_log_dir() -> io::Result<()> {
+pub fn _delete_log_dir() -> io::Result<()> {
if fs::metadata(ZELLIJ_TMP_LOG_DIR).is_ok() {
fs::remove_dir_all(ZELLIJ_TMP_LOG_DIR)
} else {
diff --git a/src/common/utils/shared.rs b/src/common/utils/shared.rs
index 5d01e78e..de15d784 100644
--- a/src/common/utils/shared.rs
+++ b/src/common/utils/shared.rs
@@ -22,9 +22,9 @@ pub fn adjust_to_size(s: &str, rows: usize, columns: usize) -> String {
if actual_len > columns {
let mut line = String::from(l);
line.truncate(columns);
- return line;
+ line
} else {
- return [l, &str::repeat(" ", columns - ansi_len(l))].concat();
+ [l, &str::repeat(" ", columns - ansi_len(l))].concat()
}
})
.chain(iter::repeat(str::repeat(" ", columns)))