@@ -447,9 +447,8 @@ impl Input {
447
447
#[ derive( Clone , Hash ) ]
448
448
pub struct OutputFilenames {
449
449
pub out_directory : PathBuf ,
450
- out_filestem : String ,
450
+ filestem : String ,
451
451
pub single_output_file : Option < PathBuf > ,
452
- extra : String ,
453
452
pub outputs : OutputTypes ,
454
453
}
455
454
@@ -465,7 +464,12 @@ impl OutputFilenames {
465
464
extra : String ,
466
465
outputs : OutputTypes ,
467
466
) -> Self {
468
- OutputFilenames { out_directory, out_filestem, single_output_file, extra, outputs }
467
+ OutputFilenames {
468
+ out_directory,
469
+ single_output_file,
470
+ outputs,
471
+ filestem : format ! ( "{}{}" , out_filestem, extra) ,
472
+ }
469
473
}
470
474
471
475
pub fn path ( & self , flavor : OutputType ) -> PathBuf {
@@ -487,7 +491,7 @@ impl OutputFilenames {
487
491
/// Like temp_path, but also supports things where there is no corresponding
488
492
/// OutputType, like noopt-bitcode or lto-bitcode.
489
493
pub fn temp_path_ext ( & self , ext : & str , codegen_unit_name : Option < & str > ) -> PathBuf {
490
- let base = self . out_directory . join ( & self . filestem ( ) ) ;
494
+ let base = self . out_directory . join ( & self . filestem ) ;
491
495
492
496
let mut extension = String :: new ( ) ;
493
497
@@ -505,16 +509,11 @@ impl OutputFilenames {
505
509
extension. push_str ( ext) ;
506
510
}
507
511
508
- let path = base. with_extension ( & extension[ ..] ) ;
509
- path
512
+ base. with_extension ( extension)
510
513
}
511
514
512
515
pub fn with_extension ( & self , extension : & str ) -> PathBuf {
513
- self . out_directory . join ( & self . filestem ( ) ) . with_extension ( extension)
514
- }
515
-
516
- pub fn filestem ( & self ) -> String {
517
- format ! ( "{}{}" , self . out_filestem, self . extra)
516
+ self . out_directory . join ( & self . filestem ) . with_extension ( extension)
518
517
}
519
518
}
520
519
0 commit comments