diff --git a/async/src/cmdline_client.rs b/async/src/cmdline_client.rs index 5070e1a..d183c53 100644 --- a/async/src/cmdline_client.rs +++ b/async/src/cmdline_client.rs @@ -268,7 +268,6 @@ impl<'a> CmdlineRunner<'a> { // perhaps a bad interaction with dup_async(), // maybe the new guard needs to be on the dup-ed // FDs? - () // pty_guard = None; // nix::sys::signal::raise(nix::sys::signal::Signal::SIGTSTP) diff --git a/async/src/knownhosts.rs b/async/src/knownhosts.rs index 2fe063a..b3deaa9 100644 --- a/async/src/knownhosts.rs +++ b/async/src/knownhosts.rs @@ -36,7 +36,7 @@ where } } -const USER_KNOWN_HOSTS: &str = &".ssh/known_hosts"; +const USER_KNOWN_HOSTS: &str = ".ssh/known_hosts"; fn user_known_hosts() -> Result { // home_dir() works fine on linux. diff --git a/embassy/src/embassy_sunset.rs b/embassy/src/embassy_sunset.rs index 9138d29..0367e1a 100644 --- a/embassy/src/embassy_sunset.rs +++ b/embassy/src/embassy_sunset.rs @@ -246,7 +246,7 @@ impl<'a> EmbassySunset<'a> { // over the write fore Stderr. Something needs to mark it done, // since the session can't proceed until it's consumed. if let Some(h) = &inner.chan_handles[num.0 as usize] { - inner.runner.discard_channel_input(&h)? + inner.runner.discard_channel_input(h)? } } } @@ -267,10 +267,8 @@ impl<'a> EmbassySunset<'a> { w.chan_write[idx].wake() } - if !inner.runner.is_client() { - if inner.runner.ready_channel_send(ch, ChanData::Stderr)?.unwrap_or(0) > 0 { - w.chan_ext[idx].wake() - } + if !inner.runner.is_client() && inner.runner.ready_channel_send(ch, ChanData::Stderr)?.unwrap_or(0) > 0 { + w.chan_ext[idx].wake() } // TODO: do we want to keep waking it? diff --git a/src/channel.rs b/src/channel.rs index f307331..71f3aaa 100644 --- a/src/channel.rs +++ b/src/channel.rs @@ -547,9 +547,9 @@ pub enum SessionCommand> { Subsystem(S), } -impl<'a, S: AsRef + 'a> Into> for &'a SessionCommand { - fn into(self) -> Req<'a> { - match self { +impl<'a, S: AsRef + 'a> From<&'a SessionCommand> for Req<'a> { + fn from(val: &'a SessionCommand) -> Self { + match val { SessionCommand::Shell => Req::Shell, SessionCommand::Exec(s) => Req::Exec(s.as_ref()), SessionCommand::Subsystem(s) => Req::Subsystem(s.as_ref()), diff --git a/src/kex.rs b/src/kex.rs index 4d80fca..ee1dee5 100644 --- a/src/kex.rs +++ b/src/kex.rs @@ -287,11 +287,9 @@ impl Kex { let algos = Self::algo_negotiation(is_client, &remote_kexinit, algo_conf)?; debug!("{algos}"); - if first_kex && algos.strict_kex { - if s.recv_seq() != 1 { - debug!("kexinit has strict kex but wasn't first packet"); - return error::PacketWrong.fail(); - } + if first_kex && algos.strict_kex && s.recv_seq() != 1 { + debug!("kexinit has strict kex but wasn't first packet"); + return error::PacketWrong.fail(); } if is_client { let p = algos.kex.make_kexdhinit()?; diff --git a/src/namelist.rs b/src/namelist.rs index 6e4dfcd..ed3e90d 100644 --- a/src/namelist.rs +++ b/src/namelist.rs @@ -36,7 +36,7 @@ pub struct StringNames<'a>(pub &'a AsciiStr); /// /// Deliberately `'static` since it should only come from hardcoded local strings /// `SSH_NAME_*` in [`crate::sshnames`]. We don't validate string contents. -#[derive(Debug)] +#[derive(Debug, Default)] pub struct LocalNames(pub Vec<&'static str, MAX_LOCAL_NAMES>); /// The general form that can store either representation