@@ -24,13 +24,13 @@ pub trait CommandStdInExt {
24
24
/// .with_stdin("42")
25
25
/// .unwrap();
26
26
/// ```
27
- fn with_stdin < S > ( self , buffer : S ) -> StdInCommand
27
+ fn with_stdin < S > ( & mut self , buffer : S ) -> StdInCommand
28
28
where
29
29
S : Into < Vec < u8 > > ;
30
30
}
31
31
32
32
impl CommandStdInExt for process:: Command {
33
- fn with_stdin < S > ( self , buffer : S ) -> StdInCommand
33
+ fn with_stdin < S > ( & mut self , buffer : S ) -> StdInCommand
34
34
where
35
35
S : Into < Vec < u8 > > ,
36
36
{
@@ -57,12 +57,12 @@ impl CommandStdInExt for process::Command {
57
57
/// .unwrap();
58
58
/// ```
59
59
#[ derive( Debug ) ]
60
- pub struct StdInCommand {
61
- cmd : process:: Command ,
60
+ pub struct StdInCommand < ' a > {
61
+ cmd : & ' a mut process:: Command ,
62
62
stdin : Vec < u8 > ,
63
63
}
64
64
65
- impl StdInCommand {
65
+ impl < ' a > StdInCommand < ' a > {
66
66
/// Executes the command as a child process, waiting for it to finish and collecting all of its
67
67
/// output.
68
68
///
@@ -97,7 +97,7 @@ impl StdInCommand {
97
97
}
98
98
}
99
99
100
- impl < ' c > OutputOkExt for & ' c mut StdInCommand {
100
+ impl < ' c , ' a > OutputOkExt for & ' c mut StdInCommand < ' a > {
101
101
fn ok ( self ) -> OutputResult {
102
102
let output = self . output ( ) . map_err ( OutputError :: with_cause) ?;
103
103
if output. status . success ( ) {
@@ -123,7 +123,7 @@ impl<'c> OutputOkExt for &'c mut StdInCommand {
123
123
}
124
124
}
125
125
126
- impl < ' c > OutputAssertExt for & ' c mut StdInCommand {
126
+ impl < ' c > OutputAssertExt for & ' c mut StdInCommand < ' c > {
127
127
fn assert ( self ) -> Assert {
128
128
let output = self . output ( ) . unwrap ( ) ;
129
129
Assert :: new ( output)
0 commit comments