File tree 2 files changed +6
-8
lines changed
2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -334,13 +334,8 @@ impl<'cfg> CleanContext<'cfg> {
334
334
}
335
335
} ;
336
336
337
- if self . dry_run {
338
- // Concise because if in verbose mode, the path will be written in
339
- // the loop below.
340
- self . config
341
- . shell ( )
342
- . concise ( |shell| Ok ( writeln ! ( shell. out( ) , "{}" , path. display( ) ) ?) ) ?;
343
- } else {
337
+ // dry-run displays paths while walking, so don't print here.
338
+ if !self . dry_run {
344
339
self . config
345
340
. shell ( )
346
341
. verbose ( |shell| shell. status ( "Removing" , path. display ( ) ) ) ?;
@@ -369,6 +364,10 @@ impl<'cfg> CleanContext<'cfg> {
369
364
let entry = entry?;
370
365
self . progress . on_clean ( ) ?;
371
366
if self . dry_run {
367
+ // This prints the path without the "Removing" status since I feel
368
+ // like it can be surprising or even frightening if cargo says it
369
+ // is removing something without actually removing it. And I can't
370
+ // come up with a different verb to use as the status.
372
371
self . config
373
372
. shell ( )
374
373
. verbose ( |shell| Ok ( writeln ! ( shell. out( ) , "{}" , entry. path( ) . display( ) ) ?) ) ?;
Original file line number Diff line number Diff line change @@ -825,7 +825,6 @@ fn clean_dry_run() {
825
825
p. cargo ( "check" ) . run ( ) ;
826
826
let before = ls_r ( ) ;
827
827
p. cargo ( "clean --dry-run" )
828
- . with_stdout ( "[CWD]/target" )
829
828
. with_stderr (
830
829
"[SUMMARY] [..] files, [..] total\n \
831
830
[WARNING] no files deleted due to --dry-run",
You can’t perform that action at this time.
0 commit comments