@@ -25,7 +25,7 @@ impl Command {
25
25
/// Run the constructed command and assert that it is successfully run.
26
26
#[ track_caller]
27
27
pub fn run ( & mut self ) -> CompletedProcess {
28
- let caller_location = :: std:: panic:: Location :: caller ( ) ;
28
+ let caller_location = std:: panic:: Location :: caller ( ) ;
29
29
let caller_line_number = caller_location. line ( ) ;
30
30
31
31
let output = self . command_output ( ) ;
@@ -38,7 +38,7 @@ impl Command {
38
38
/// Run the constructed command and assert that it does not successfully run.
39
39
#[ track_caller]
40
40
pub fn run_fail ( & mut self ) -> CompletedProcess {
41
- let caller_location = :: std:: panic:: Location :: caller ( ) ;
41
+ let caller_location = std:: panic:: Location :: caller ( ) ;
42
42
let caller_line_number = caller_location. line ( ) ;
43
43
44
44
let output = self . command_output ( ) ;
@@ -107,33 +107,33 @@ impl CompletedProcess {
107
107
108
108
/// Checks that trimmed `stdout` matches trimmed `content`.
109
109
#[ track_caller]
110
- pub fn assert_stdout_equals ( self , content : & str ) -> Self {
111
- assert_eq ! ( self . stdout_utf8( ) . trim( ) , content. trim( ) ) ;
110
+ pub fn assert_stdout_equals < S : AsRef < str > > ( self , content : S ) -> Self {
111
+ assert_eq ! ( self . stdout_utf8( ) . trim( ) , content. as_ref ( ) . trim( ) ) ;
112
112
self
113
113
}
114
114
115
115
#[ track_caller]
116
- pub fn assert_stdout_not_contains ( self , needle : & str ) -> Self {
117
- assert_not_contains ( & self . stdout_utf8 ( ) , needle) ;
116
+ pub fn assert_stdout_not_contains < S : AsRef < str > > ( self , needle : S ) -> Self {
117
+ assert_not_contains ( & self . stdout_utf8 ( ) , needle. as_ref ( ) ) ;
118
118
self
119
119
}
120
120
121
121
/// Checks that trimmed `stderr` matches trimmed `content`.
122
122
#[ track_caller]
123
- pub fn assert_stderr_equals ( self , content : & str ) -> Self {
124
- assert_eq ! ( self . stderr_utf8( ) . trim( ) , content. trim( ) ) ;
123
+ pub fn assert_stderr_equals < S : AsRef < str > > ( self , content : S ) -> Self {
124
+ assert_eq ! ( self . stderr_utf8( ) . trim( ) , content. as_ref ( ) . trim( ) ) ;
125
125
self
126
126
}
127
127
128
128
#[ track_caller]
129
- pub fn assert_stderr_contains ( self , needle : & str ) -> Self {
130
- assert ! ( self . stderr_utf8( ) . contains( needle) ) ;
129
+ pub fn assert_stderr_contains < S : AsRef < str > > ( self , needle : S ) -> Self {
130
+ assert ! ( self . stderr_utf8( ) . contains( needle. as_ref ( ) ) ) ;
131
131
self
132
132
}
133
133
134
134
#[ track_caller]
135
- pub fn assert_stderr_not_contains ( self , needle : & str ) -> Self {
136
- assert_not_contains ( & self . stdout_utf8 ( ) , needle) ;
135
+ pub fn assert_stderr_not_contains < S : AsRef < str > > ( self , needle : S ) -> Self {
136
+ assert_not_contains ( & self . stdout_utf8 ( ) , needle. as_ref ( ) ) ;
137
137
self
138
138
}
139
139
0 commit comments