File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -502,13 +502,15 @@ impl Config {
502
502
///
503
503
/// # Panics
504
504
///
505
- /// Panics if `output` is not formatted correctly or if one of the underlying
505
+ /// Panics if `output` is not formatted correctly or if one of the underlying
506
506
/// compiler commands fails. It can also panic if it fails reading file names
507
507
/// or creating directories.
508
508
pub fn compile ( & self , output : & str ) {
509
- let name_start = if output. starts_with ( "lib" ) { 3 } else { 0 } ;
510
- let name_end = if output. ends_with ( ".a" ) { output. len ( ) - 2 } else { output. len ( ) } ;
511
- let lib_name = & output[ name_start..name_end] ;
509
+ let lib_name = if output. starts_with ( "lib" ) && output. ends_with ( ".a" ) {
510
+ & output[ 3 ..output. len ( ) - 2 ]
511
+ } else {
512
+ & output
513
+ } ;
512
514
let dst = self . get_out_dir ( ) ;
513
515
514
516
let mut objects = Vec :: new ( ) ;
You can’t perform that action at this time.
0 commit comments