@@ -24,13 +24,13 @@ pub trait CommandStdInExt {
2424 /// .with_stdin("42")
2525 /// .unwrap();
2626 /// ```
27- fn with_stdin < S > ( self , buffer : S ) -> StdInCommand
27+ fn with_stdin < S > ( & mut self , buffer : S ) -> StdInCommand
2828 where
2929 S : Into < Vec < u8 > > ;
3030}
3131
3232impl CommandStdInExt for process:: Command {
33- fn with_stdin < S > ( self , buffer : S ) -> StdInCommand
33+ fn with_stdin < S > ( & mut self , buffer : S ) -> StdInCommand
3434 where
3535 S : Into < Vec < u8 > > ,
3636 {
@@ -57,12 +57,12 @@ impl CommandStdInExt for process::Command {
5757/// .unwrap();
5858/// ```
5959#[ derive( Debug ) ]
60- pub struct StdInCommand {
61- cmd : process:: Command ,
60+ pub struct StdInCommand < ' a > {
61+ cmd : & ' a mut process:: Command ,
6262 stdin : Vec < u8 > ,
6363}
6464
65- impl StdInCommand {
65+ impl < ' a > StdInCommand < ' a > {
6666 /// Executes the command as a child process, waiting for it to finish and collecting all of its
6767 /// output.
6868 ///
@@ -97,7 +97,7 @@ impl StdInCommand {
9797 }
9898}
9999
100- impl < ' c > OutputOkExt for & ' c mut StdInCommand {
100+ impl < ' c , ' a > OutputOkExt for & ' c mut StdInCommand < ' a > {
101101 fn ok ( self ) -> OutputResult {
102102 let output = self . output ( ) . map_err ( OutputError :: with_cause) ?;
103103 if output. status . success ( ) {
@@ -123,7 +123,7 @@ impl<'c> OutputOkExt for &'c mut StdInCommand {
123123 }
124124}
125125
126- impl < ' c > OutputAssertExt for & ' c mut StdInCommand {
126+ impl < ' c > OutputAssertExt for & ' c mut StdInCommand < ' c > {
127127 fn assert ( self ) -> Assert {
128128 let output = self . output ( ) . unwrap ( ) ;
129129 Assert :: new ( output)
0 commit comments