@@ -91,10 +91,12 @@ impl BootstrapCommand {
91
91
self
92
92
}
93
93
94
+ #[ must_use]
94
95
pub fn get_envs ( & self ) -> CommandEnvs < ' _ > {
95
96
self . command . get_envs ( )
96
97
}
97
98
99
+ #[ must_use]
98
100
pub fn get_args ( & self ) -> CommandArgs < ' _ > {
99
101
self . command . get_args ( )
100
102
}
@@ -109,14 +111,17 @@ impl BootstrapCommand {
109
111
self
110
112
}
111
113
114
+ #[ must_use]
112
115
pub fn delay_failure ( self ) -> Self {
113
116
Self { failure_behavior : BehaviorOnFailure :: DelayFail , ..self }
114
117
}
115
118
119
+ #[ must_use]
116
120
pub fn fail_fast ( self ) -> Self {
117
121
Self { failure_behavior : BehaviorOnFailure :: Exit , ..self }
118
122
}
119
123
124
+ #[ must_use]
120
125
pub fn allow_failure ( self ) -> Self {
121
126
Self { failure_behavior : BehaviorOnFailure :: Ignore , ..self }
122
127
}
@@ -127,11 +132,13 @@ impl BootstrapCommand {
127
132
}
128
133
129
134
/// Capture all output of the command, do not print it.
135
+ #[ must_use]
130
136
pub fn capture ( self ) -> Self {
131
137
Self { stdout : OutputMode :: Capture , stderr : OutputMode :: Capture , ..self }
132
138
}
133
139
134
140
/// Capture stdout of the command, do not print it.
141
+ #[ must_use]
135
142
pub fn capture_stdout ( self ) -> Self {
136
143
Self { stdout : OutputMode :: Capture , ..self }
137
144
}
@@ -178,36 +185,43 @@ pub struct CommandOutput {
178
185
}
179
186
180
187
impl CommandOutput {
188
+ #[ must_use]
181
189
pub fn did_not_start ( ) -> Self {
182
190
Self { status : CommandStatus :: DidNotStart , stdout : vec ! [ ] , stderr : vec ! [ ] }
183
191
}
184
192
193
+ #[ must_use]
185
194
pub fn is_success ( & self ) -> bool {
186
195
match self . status {
187
196
CommandStatus :: Finished ( status) => status. success ( ) ,
188
197
CommandStatus :: DidNotStart => false ,
189
198
}
190
199
}
191
200
201
+ #[ must_use]
192
202
pub fn is_failure ( & self ) -> bool {
193
203
!self . is_success ( )
194
204
}
195
205
206
+ #[ must_use]
196
207
pub fn status ( & self ) -> Option < ExitStatus > {
197
208
match self . status {
198
209
CommandStatus :: Finished ( status) => Some ( status) ,
199
210
CommandStatus :: DidNotStart => None ,
200
211
}
201
212
}
202
213
214
+ #[ must_use]
203
215
pub fn stdout ( & self ) -> String {
204
216
String :: from_utf8 ( self . stdout . clone ( ) ) . expect ( "Cannot parse process stdout as UTF-8" )
205
217
}
206
218
219
+ #[ must_use]
207
220
pub fn stdout_if_ok ( & self ) -> Option < String > {
208
221
if self . is_success ( ) { Some ( self . stdout ( ) ) } else { None }
209
222
}
210
223
224
+ #[ must_use]
211
225
pub fn stderr ( & self ) -> String {
212
226
String :: from_utf8 ( self . stderr . clone ( ) ) . expect ( "Cannot parse process stderr as UTF-8" )
213
227
}
0 commit comments