@@ -190,7 +190,6 @@ impl JoinOnDrop {
190
190
191
191
#[ derive( Debug ) ]
192
192
enum PopStyle {
193
- Erase ,
194
193
Abort ,
195
194
Replace ( String ) ,
196
195
}
@@ -232,7 +231,6 @@ impl Text {
232
231
impl ProgressHandler {
233
232
fn pop ( & mut self , msg : String , new_leftover_msg : PopStyle , parent : String ) {
234
233
let new_msg = match new_leftover_msg {
235
- PopStyle :: Erase => None ,
236
234
PopStyle :: Abort => {
237
235
self . aborted = true ;
238
236
None
@@ -251,25 +249,24 @@ impl Text {
251
249
* done = true ;
252
250
let spinner = spinner. clone ( ) ;
253
251
254
- let print = new_msg. is_some ( ) ;
255
-
256
252
if let Some ( new_msg) = new_msg {
257
253
spinner. finish_with_message ( new_msg) ;
258
254
} else {
259
- spinner. finish ( ) ;
255
+ spinner. finish_and_clear ( ) ;
256
+ return ;
260
257
}
261
258
let parent = children[ "" ] . 0 . clone ( ) ;
262
259
if children. values ( ) . all ( |& ( _, done) | done) {
263
260
self . bars . remove ( & parent) ;
264
- if print {
261
+ if self . progress . is_hidden ( ) {
265
262
self . bars
266
263
. println ( format ! ( "{} {}" , parent. prefix( ) , parent. message( ) ) )
267
264
. unwrap ( ) ;
268
265
}
269
266
for ( msg, ( child, _) ) in children. iter ( ) {
270
267
if !msg. is_empty ( ) {
271
268
self . bars . remove ( child) ;
272
- if print {
269
+ if self . progress . is_hidden ( ) {
273
270
self . bars
274
271
. println ( format ! (
275
272
" {} {}" ,
@@ -403,10 +400,6 @@ impl Text {
403
400
Self :: start_thread ( OutputVerbosity :: Progress )
404
401
}
405
402
406
- fn is_quiet_output ( & self ) -> bool {
407
- matches ! ( self . progress, OutputVerbosity :: Progress )
408
- }
409
-
410
403
fn is_full_output ( & self ) -> bool {
411
404
matches ! ( self . progress, OutputVerbosity :: Full )
412
405
}
@@ -433,8 +426,6 @@ impl TestStatus for TextTest {
433
426
fn done ( & self , result : & TestResult , aborted : bool ) {
434
427
let new_leftover_msg = if aborted {
435
428
PopStyle :: Abort
436
- } else if self . text . is_quiet_output ( ) {
437
- PopStyle :: Erase
438
429
} else {
439
430
let result = match result {
440
431
Ok ( TestOk :: Ok ) => "ok" . green ( ) ,
0 commit comments