Skip to content

Commit 513a4fd

Browse files
committed
Avoid an intermediate Option
1 parent d01712d commit 513a4fd

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

src/status_emitter.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,6 @@ impl Text {
230230

231231
impl ProgressHandler {
232232
fn pop(&mut self, msg: String, new_leftover_msg: PopStyle, parent: String) {
233-
let new_msg = match new_leftover_msg {
234-
PopStyle::Abort => {
235-
self.aborted = true;
236-
None
237-
}
238-
PopStyle::Replace(msg) => Some(msg),
239-
};
240233
let Some(children) = self.threads.get_mut(&parent) else {
241234
// This can happen when a test was not run at all, because it failed directly during
242235
// comment parsing.
@@ -248,12 +241,13 @@ impl Text {
248241
};
249242
*done = true;
250243
let spinner = spinner.clone();
251-
252-
if let Some(new_msg) = new_msg {
253-
spinner.finish_with_message(new_msg);
254-
} else {
255-
spinner.finish_and_clear();
256-
return;
244+
match new_leftover_msg {
245+
PopStyle::Replace(new_msg) => spinner.finish_with_message(new_msg),
246+
PopStyle::Abort => {
247+
self.aborted = true;
248+
spinner.finish_and_clear();
249+
return;
250+
}
257251
}
258252
let parent = children[""].0.clone();
259253
if children.values().all(|&(_, done)| done) {

0 commit comments

Comments
 (0)