@@ -76,8 +76,10 @@ pub struct CommandFingerprint {
76
76
cwd : Option < PathBuf > ,
77
77
}
78
78
79
- impl FormatShortCmd for CommandFingerprint {
80
- fn format_short_cmd ( & self ) -> String {
79
+ impl CommandFingerprint {
80
+ /// Helper method to format both Command and BootstrapCommand as a short execution line,
81
+ /// without all the other details (e.g. environment variables).
82
+ pub fn format_short_cmd ( & self ) -> String {
81
83
let program = Path :: new ( & self . program ) ;
82
84
let mut line = vec ! [ program. file_name( ) . unwrap( ) . to_str( ) . unwrap( ) . to_owned( ) ] ;
83
85
line. extend ( self . args . iter ( ) . map ( |arg| arg. to_string_lossy ( ) . into_owned ( ) ) ) ;
@@ -545,29 +547,6 @@ impl Default for CommandOutput {
545
547
}
546
548
}
547
549
548
- /// Helper trait to format both Command and BootstrapCommand as a short execution line,
549
- /// without all the other details (e.g. environment variables).
550
- pub trait FormatShortCmd {
551
- fn format_short_cmd ( & self ) -> String ;
552
- }
553
-
554
- #[ cfg( feature = "tracing" ) ]
555
- impl FormatShortCmd for BootstrapCommand {
556
- fn format_short_cmd ( & self ) -> String {
557
- self . command . format_short_cmd ( )
558
- }
559
- }
560
-
561
- #[ cfg( feature = "tracing" ) ]
562
- impl FormatShortCmd for Command {
563
- fn format_short_cmd ( & self ) -> String {
564
- let program = Path :: new ( self . get_program ( ) ) ;
565
- let mut line = vec ! [ program. file_name( ) . unwrap( ) . to_str( ) . unwrap( ) ] ;
566
- line. extend ( self . get_args ( ) . map ( |arg| arg. to_str ( ) . unwrap ( ) ) ) ;
567
- line. join ( " " )
568
- }
569
- }
570
-
571
550
#[ derive( Clone , Default ) ]
572
551
pub struct ExecutionContext {
573
552
dry_run : DryRun ,
0 commit comments