@@ -34,8 +34,7 @@ pub enum OutputMode {
34
34
/// If you want to allow failures, use [allow_failure].
35
35
/// If you want to delay failures until the end of bootstrap, use [delay_failure].
36
36
///
37
- /// By default, the command will print its stdout/stderr to stdout/stderr of bootstrap
38
- /// ([OutputMode::Print]).
37
+ /// By default, the command will print its stdout/stderr to stdout/stderr of bootstrap ([OutputMode::Print]).
39
38
/// If you want to handle the output programmatically, use [BootstrapCommand::capture].
40
39
///
41
40
/// Bootstrap will print a debug log to stdout if the command fails and failure is not allowed.
@@ -144,8 +143,8 @@ impl From<Command> for BootstrapCommand {
144
143
}
145
144
}
146
145
147
- /// Represents the outcome of starting a command .
148
- enum CommandOutcome {
146
+ /// Represents the current status of `BootstrapCommand` .
147
+ enum CommandStatus {
149
148
/// The command has started and finished with some status.
150
149
Finished ( ExitStatus ) ,
151
150
/// It was not even possible to start the command.
@@ -155,20 +154,20 @@ enum CommandOutcome {
155
154
/// Represents the output of an executed process.
156
155
#[ allow( unused) ]
157
156
pub struct CommandOutput {
158
- outcome : CommandOutcome ,
157
+ status : CommandStatus ,
159
158
stdout : Vec < u8 > ,
160
159
stderr : Vec < u8 > ,
161
160
}
162
161
163
162
impl CommandOutput {
164
163
pub fn did_not_start ( ) -> Self {
165
- Self { outcome : CommandOutcome :: DidNotStart , stdout : vec ! [ ] , stderr : vec ! [ ] }
164
+ Self { status : CommandStatus :: DidNotStart , stdout : vec ! [ ] , stderr : vec ! [ ] }
166
165
}
167
166
168
167
pub fn is_success ( & self ) -> bool {
169
- match self . outcome {
170
- CommandOutcome :: Finished ( status) => status. success ( ) ,
171
- CommandOutcome :: DidNotStart => false ,
168
+ match self . status {
169
+ CommandStatus :: Finished ( status) => status. success ( ) ,
170
+ CommandStatus :: DidNotStart => false ,
172
171
}
173
172
}
174
173
@@ -177,9 +176,9 @@ impl CommandOutput {
177
176
}
178
177
179
178
pub fn status ( & self ) -> Option < ExitStatus > {
180
- match self . outcome {
181
- CommandOutcome :: Finished ( status) => Some ( status) ,
182
- CommandOutcome :: DidNotStart => None ,
179
+ match self . status {
180
+ CommandStatus :: Finished ( status) => Some ( status) ,
181
+ CommandStatus :: DidNotStart => None ,
183
182
}
184
183
}
185
184
@@ -199,7 +198,7 @@ impl CommandOutput {
199
198
impl Default for CommandOutput {
200
199
fn default ( ) -> Self {
201
200
Self {
202
- outcome : CommandOutcome :: Finished ( ExitStatus :: default ( ) ) ,
201
+ status : CommandStatus :: Finished ( ExitStatus :: default ( ) ) ,
203
202
stdout : vec ! [ ] ,
204
203
stderr : vec ! [ ] ,
205
204
}
@@ -209,7 +208,7 @@ impl Default for CommandOutput {
209
208
impl From < Output > for CommandOutput {
210
209
fn from ( output : Output ) -> Self {
211
210
Self {
212
- outcome : CommandOutcome :: Finished ( output. status ) ,
211
+ status : CommandStatus :: Finished ( output. status ) ,
213
212
stdout : output. stdout ,
214
213
stderr : output. stderr ,
215
214
}
0 commit comments