diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/commands.rs | 4 | ||||
-rw-r--r-- | src/tests/e2e/cases.rs | 41 | ||||
-rw-r--r-- | src/tests/e2e/remote_runner.rs | 6 |
3 files changed, 25 insertions, 26 deletions
diff --git a/src/commands.rs b/src/commands.rs index d1bcb4561..ec6268f21 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -40,7 +40,7 @@ pub(crate) fn kill_all_sessions(yes: bool) { process::exit(1); } } - for session in sessions.iter() { + for session in &sessions { kill_session_impl(session); } process::exit(0); @@ -131,7 +131,7 @@ fn attach_with_session_name( config_options: Options, create: bool, ) -> ClientInfo { - match session_name.as_ref() { + match &session_name { Some(session) if create => { if !session_exists(session).unwrap() { ClientInfo::New(session_name.unwrap()) diff --git a/src/tests/e2e/cases.rs b/src/tests/e2e/cases.rs index 0198adfe0..0585c373b 100644 --- a/src/tests/e2e/cases.rs +++ b/src/tests/e2e/cases.rs @@ -5,6 +5,7 @@ use zellij_utils::{pane_size::Size, position::Position}; use rand::Rng; +use std::fmt::Write; use std::path::Path; use super::remote_runner::{RemoteRunner, RemoteTerminal, Step}; @@ -231,26 +232,26 @@ pub fn scrolling_inside_a_pane() { if remote_terminal.cursor_position_is(63, 2) && remote_terminal.tip_appears() { // cursor is in the newly opened second pane let mut content_to_send = String::new(); - content_to_send.push_str(&format!("{:0<56}", "line1 ")); - content_to_send.push_str(&format!("{:0<58}", "line2 ")); - content_to_send.push_str(&format!("{:0<58}", "line3 ")); - content_to_send.push_str(&format!("{:0<58}", "line4 ")); - content_to_send.push_str(&format!("{:0<58}", "line5 ")); - content_to_send.push_str(&format!("{:0<58}", "line6 ")); - content_to_send.push_str(&format!("{:0<58}", "line7 ")); - content_to_send.push_str(&format!("{:0<58}", "line8 ")); - content_to_send.push_str(&format!("{:0<58}", "line9 ")); - content_to_send.push_str(&format!("{:0<58}", "line10 ")); - content_to_send.push_str(&format!("{:0<58}", "line11 ")); - content_to_send.push_str(&format!("{:0<58}", "line12 ")); - content_to_send.push_str(&format!("{:0<58}", "line13 ")); - content_to_send.push_str(&format!("{:0<58}", "line14 ")); - content_to_send.push_str(&format!("{:0<58}", "line15 ")); - content_to_send.push_str(&format!("{:0<58}", "line16 ")); - content_to_send.push_str(&format!("{:0<58}", "line17 ")); - content_to_send.push_str(&format!("{:0<58}", "line18 ")); - content_to_send.push_str(&format!("{:0<58}", "line19 ")); - content_to_send.push_str(&format!("{:0<57}", "line20 ")); + write!(&mut content_to_send, "{:0<56}", "line1 ").unwrap(); + write!(&mut content_to_send, "{:0<58}", "line2 ").unwrap(); + write!(&mut content_to_send, "{:0<58}", "line3 ").unwrap(); + write!(&mut content_to_send, "{:0<58}", "line4 ").unwrap(); + write!(&mut content_to_send, "{:0<58}", "line5 ").unwrap(); + write!(&mut content_to_send, "{:0<58}", "line6 ").unwrap(); + write!(&mut content_to_send, "{:0<58}", "line7 ").unwrap(); + write!(&mut content_to_send, "{:0<58}", "line8 ").unwrap(); + write!(&mut content_to_send, "{:0<58}", "line9 ").unwrap(); + write!(&mut content_to_send, "{:0<58}", "line10 ").unwrap(); + write!(&mut content_to_send, "{:0<58}", "line11 ").unwrap(); + write!(&mut content_to_send, "{:0<58}", "line12 ").unwrap(); + write!(&mut content_to_send, "{:0<58}", "line13 ").unwrap(); + write!(&mut content_to_send, "{:0<58}", "line14 ").unwrap(); + write!(&mut content_to_send, "{:0<58}", "line15 ").unwrap(); + write!(&mut content_to_send, "{:0<58}", "line16 ").unwrap(); + write!(&mut content_to_send, "{:0<58}", "line17 ").unwrap(); + write!(&mut content_to_send, "{:0<58}", "line18 ").unwrap(); + write!(&mut content_to_send, "{:0<58}", "line19 ").unwrap(); + write!(&mut content_to_send, "{:0<57}", "line20 ").unwrap(); remote_terminal.send_key(content_to_send.as_bytes()); diff --git a/src/tests/e2e/remote_runner.rs b/src/tests/e2e/remote_runner.rs index 46e2b88f1..e27e9fc21 100644 --- a/src/tests/e2e/remote_runner.rs +++ b/src/tests/e2e/remote_runner.rs @@ -45,14 +45,12 @@ fn setup_remote_environment(channel: &mut ssh2::Channel, win_size: Size) { .request_pty("xterm", None, Some((columns, rows, 0, 0))) .unwrap(); channel.shell().unwrap(); - channel.write_all("export PS1=\"$ \"\n".as_bytes()).unwrap(); + channel.write_all(b"export PS1=\"$ \"\n").unwrap(); channel.flush().unwrap(); } fn stop_zellij(channel: &mut ssh2::Channel) { - channel - .write_all("killall -KILL zellij\n".as_bytes()) - .unwrap(); + channel.write_all(b"killall -KILL zellij\n").unwrap(); } fn start_zellij(channel: &mut ssh2::Channel) { |