File tree 4 files changed +7
-6
lines changed
4 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -490,10 +490,10 @@ pub enum Input {
490
490
}
491
491
492
492
impl Input {
493
- pub fn filestem ( & self ) -> String {
493
+ pub fn filestem ( & self ) -> & str {
494
494
match * self {
495
- Input :: File ( ref ifile) => ifile. file_stem ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ,
496
- Input :: Str { .. } => "rust_out" . to_string ( ) ,
495
+ Input :: File ( ref ifile) => ifile. file_stem ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) ,
496
+ Input :: Str { .. } => "rust_out" ,
497
497
}
498
498
}
499
499
@@ -1406,6 +1406,7 @@ pub fn default_configuration(sess: &Session) -> ast::CrateConfig {
1406
1406
let atomic_cas = sess. target . target . options . atomic_cas ;
1407
1407
1408
1408
let mut ret = FxHashSet :: default ( ) ;
1409
+ ret. reserve ( 6 ) ; // the minimum number of insertions
1409
1410
// Target bindings.
1410
1411
ret. insert ( ( Symbol :: intern ( "target_os" ) , Some ( Symbol :: intern ( os) ) ) ) ;
1411
1412
if let Some ( ref fam) = sess. target . target . options . target_family {
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ impl<'a> FileSearch<'a> {
41
41
F : FnMut ( & Path , PathKind )
42
42
{
43
43
let mut visited_dirs = FxHashSet :: default ( ) ;
44
-
44
+ visited_dirs . reserve ( self . search_paths . paths . len ( ) + 1 ) ;
45
45
for ( path, kind) in self . search_paths . iter ( self . kind ) {
46
46
f ( path, kind) ;
47
47
visited_dirs. insert ( path. to_path_buf ( ) ) ;
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ use session::{early_error, config};
14
14
15
15
#[ derive( Clone , Debug ) ]
16
16
pub struct SearchPaths {
17
- paths : Vec < ( PathKind , PathBuf ) > ,
17
+ crate paths : Vec < ( PathKind , PathBuf ) > ,
18
18
}
19
19
20
20
pub struct Iter < ' a > {
Original file line number Diff line number Diff line change @@ -1657,7 +1657,7 @@ pub fn build_output_filenames(
1657
1657
. crate_name
1658
1658
. clone ( )
1659
1659
. or_else ( || attr:: find_crate_name ( attrs) . map ( |n| n. to_string ( ) ) )
1660
- . unwrap_or_else ( || input. filestem ( ) ) ;
1660
+ . unwrap_or_else ( || input. filestem ( ) . to_owned ( ) ) ;
1661
1661
1662
1662
OutputFilenames {
1663
1663
out_directory : dirpath,
You can’t perform that action at this time.
0 commit comments