aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/utils
diff options
context:
space:
mode:
authora-kenji <aks.kenji@protonmail.com>2021-04-17 00:15:52 +0200
committera-kenji <aks.kenji@protonmail.com>2021-04-17 00:15:52 +0200
commit60ad7494739b4cbcd857e74df9d05830459323eb (patch)
tree772d24c71de04d150a7b7a447842429e5a82e786 /src/common/utils
parentAdd Unbind Setting for Keybinds (diff)
parentMerge branch 'main' of github.com:zellij-org/zellij (diff)
downloadsl0ppij-60ad7494739b4cbcd857e74df9d05830459323eb.tar.gz
sl0ppij-60ad7494739b4cbcd857e74df9d05830459323eb.tar.xz
sl0ppij-60ad7494739b4cbcd857e74df9d05830459323eb.zip
Merge branch 'main' of https://github.com/zellij-org/zellij into unbind-default-keys
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 93892d4f..d5ba943b 100644
--- a/src/common/utils/shared.rs
+++ b/src/common/utils/shared.rs
@@ -18,9 +18,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)))