summaryrefslogtreecommitdiffstats
path: root/zellij-client
diff options
context:
space:
mode:
authorPaulo Coelho <9609090+prscoelho@users.noreply.github.com>2021-09-09 09:24:03 +0100
committerGitHub <noreply@github.com>2021-09-09 10:24:03 +0200
commit6d0c5a56f54eb3f47991cc2743587103cffc123c (patch)
treef827b819cbf2b3c0b50899b1a2aabdf8b714efe7 /zellij-client
parent0f0122fb596e336d36dad04e390273dd3f3f430d (diff)
style(clippy): various fixes (#704)
* test: fix clippy unused_io_amount * chore(clippy): various clippy fixes needless_borrow, let_and_return, vec_init_then_push, unit_arg, useless_format, field_reassign_with_default, redundant_clone
Diffstat (limited to 'zellij-client')
-rw-r--r--zellij-client/src/unit/input_handler_tests.rs18
1 files changed, 8 insertions, 10 deletions
diff --git a/zellij-client/src/unit/input_handler_tests.rs b/zellij-client/src/unit/input_handler_tests.rs
index a9b86a75d..17bb1b0f8 100644
--- a/zellij-client/src/unit/input_handler_tests.rs
+++ b/zellij-client/src/unit/input_handler_tests.rs
@@ -110,8 +110,7 @@ impl ClientOsApi for FakeClientOsApi {
if stdin_events.is_empty() {
panic!("ran out of stdin events!");
}
- let next_event = stdin_events.remove(0);
- next_event
+ stdin_events.remove(0)
}
fn box_clone(&self) -> Box<dyn ClientOsApi> {
unimplemented!()
@@ -174,14 +173,14 @@ pub fn quit_breaks_input_loop() {
let send_client_instructions = SenderWithContext::new(send_client_instructions);
let default_mode = InputMode::Normal;
- drop(input_loop(
+ input_loop(
client_os_api,
config,
options,
command_is_executing,
send_client_instructions,
default_mode,
- ));
+ );
let expected_actions_sent_to_server = vec![Action::Quit];
let received_actions = extract_actions_sent_to_server(events_sent_to_server);
assert_eq!(
@@ -192,8 +191,7 @@ pub fn quit_breaks_input_loop() {
#[test]
pub fn move_focus_left_in_pane_mode() {
- let mut stdin_events = vec![];
- stdin_events.push(commands::MOVE_FOCUS_LEFT_IN_NORMAL_MODE.to_vec());
+ let stdin_events = vec![commands::MOVE_FOCUS_LEFT_IN_NORMAL_MODE.to_vec()];
let events_sent_to_server = Arc::new(Mutex::new(vec![]));
let command_is_executing = CommandIsExecuting::new();
let client_os_api = Box::new(FakeClientOsApi::new(
@@ -210,14 +208,14 @@ pub fn move_focus_left_in_pane_mode() {
let send_client_instructions = SenderWithContext::new(send_client_instructions);
let default_mode = InputMode::Normal;
- drop(input_loop(
+ input_loop(
client_os_api,
config,
options,
command_is_executing,
send_client_instructions,
default_mode,
- ));
+ );
let expected_actions_sent_to_server =
vec![Action::MoveFocusOrTab(Direction::Left), Action::Quit];
let received_actions = extract_actions_sent_to_server(events_sent_to_server);
@@ -250,14 +248,14 @@ pub fn bracketed_paste() {
let send_client_instructions = SenderWithContext::new(send_client_instructions);
let default_mode = InputMode::Normal;
- drop(input_loop(
+ input_loop(
client_os_api,
config,
options,
command_is_executing,
send_client_instructions,
default_mode,
- ));
+ );
let expected_actions_sent_to_server = vec![
Action::Write(commands::BRACKETED_PASTE_START.to_vec()),
Action::Write(commands::MOVE_FOCUS_LEFT_IN_NORMAL_MODE.to_vec()), // keys were directly written to server and not interpreted