@@ -232,10 +232,11 @@ fn ssh_base_command(proxy_command: &str) -> Command {
232232 command
233233}
234234
235- async fn exec_or_wait ( mut command : Command , replace_process : bool ) -> Result < i32 > {
235+ async fn exec_or_wait ( command : Command , replace_process : bool ) -> Result < i32 > {
236236 if replace_process && std:: io:: stdin ( ) . is_terminal ( ) {
237237 #[ cfg( unix) ]
238238 {
239+ let mut command = command;
239240 let err = command. exec ( ) ;
240241 return Err ( miette:: miette!( "failed to exec ssh: {err}" ) ) ;
241242 }
@@ -328,13 +329,17 @@ struct ConnectCancellation {
328329}
329330
330331impl ConnectCancellation {
332+ // Unix signal registration is fallible; retain the shared API on Windows.
333+ #[ cfg_attr( not( unix) , allow( clippy:: unnecessary_wraps) ) ]
331334 fn new ( ) -> Result < Self > {
332335 Ok ( Self {
333336 #[ cfg( unix) ]
334337 signals : TerminationSignals :: new ( ) ?,
335338 } )
336339 }
337340
341+ // Waiting consumes mutable signal state only on Unix.
342+ #[ cfg_attr( not( unix) , allow( clippy:: needless_pass_by_ref_mut) ) ]
338343 async fn wait < F , T > ( & mut self , future : F ) -> std:: result:: Result < T , i32 >
339344 where
340345 F : Future < Output = T > ,
@@ -380,6 +385,8 @@ async fn terminate_and_reap_child(child: &mut Child, signal: Signal) -> Result<i
380385 Ok ( 128 + signal as i32 )
381386}
382387
388+ // The shared cancellation state is mutated by the Unix signal receiver.
389+ #[ cfg_attr( not( unix) , allow( clippy:: needless_pass_by_ref_mut) ) ]
383390async fn run_main_attach_supervised (
384391 session : & SshSessionConfig ,
385392 cancellation : & mut ConnectCancellation ,
0 commit comments