aboutsummaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorBrooks J Rady <b.j.rady@gmail.com>2021-04-13 18:14:13 +0100
committerBrooks J Rady <b.j.rady@gmail.com>2021-04-13 18:14:13 +0100
commit6f4dcfbf65f522b318ebd359df5658a72b618392 (patch)
treed4b1591be1139a4b67d3d4f0b340a133a27ba189 /src/common
parentfix(ci): unbreak things (diff)
downloadsl0ppij-6f4dcfbf65f522b318ebd359df5658a72b618392.tar.gz
sl0ppij-6f4dcfbf65f522b318ebd359df5658a72b618392.tar.xz
sl0ppij-6f4dcfbf65f522b318ebd359df5658a72b618392.zip
fix(clippy): get ci passing again
Diffstat (limited to 'src/common')
-rw-r--r--src/common/input/config.rs2
-rw-r--r--src/common/os_input_output.rs13
-rw-r--r--src/common/screen.rs2
-rw-r--r--src/common/utils/logging.rs6
-rw-r--r--src/common/utils/shared.rs4
5 files changed, 10 insertions, 17 deletions
diff --git a/src/common/input/config.rs b/src/common/input/config.rs
index 4bb9e10f..1926b11c 100644
--- a/src/common/input/config.rs
+++ b/src/common/input/config.rs
@@ -51,7 +51,6 @@ impl Config {
}
/// Deserializes from given path.
- #[allow(unused_must_use)]
pub fn new(path: &Path) -> ConfigResult {
match File::open(path) {
Ok(mut file) => {
@@ -90,7 +89,6 @@ impl Config {
}
}
- //#[allow(unused_must_use)]
/// In order not to mess up tests from changing configurations
#[cfg(test)]
pub fn from_cli_config(_: Option<ConfigCli>) -> ConfigResult {
diff --git a/src/common/os_input_output.rs b/src/common/os_input_output.rs
index 013b9f12..35d77fdd 100644
--- a/src/common/os_input_output.rs
+++ b/src/common/os_input_output.rs
@@ -84,15 +84,10 @@ fn handle_command_exit(mut child: Child) {
}
for signal in signals.pending() {
- // FIXME: We need to handle more signals here!
- #[allow(clippy::single_match)]
- match signal {
- SIGINT => {
- child.kill().unwrap();
- child.wait().unwrap();
- break 'handle_exit;
- }
- _ => {}
+ if let SIGINT = signal {
+ child.kill().unwrap();
+ child.wait().unwrap();
+ break 'handle_exit;
}
}
}
diff --git a/src/common/screen.rs b/src/common/screen.rs
index 1e37ca4f..01ac04fc 100644
--- a/src/common/screen.rs
+++ b/src/common/screen.rs
@@ -81,7 +81,9 @@ pub struct Screen {
}
impl Screen {
+ // FIXME: This lint needs actual fixing! Maybe by bundling the Senders
/// Creates and returns a new [`Screen`].
+ #[allow(clippy::too_many_arguments)]
pub fn new(
receive_screen_instructions: Receiver<(ScreenInstruction, ErrorContext)>,
send_pty_instructions: SenderWithContext<PtyInstruction>,
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)))