@@ -307,7 +307,7 @@ fn build() -> io::Result<()> {
307
307
// run ./configure
308
308
let output = configure
309
309
. output ( )
310
- . expect ( & format ! ( "{:?} failed" , configure) ) ;
310
+ . unwrap_or_else ( |_| panic ! ( "{:?} failed" , configure) ) ;
311
311
if !output. status . success ( ) {
312
312
println ! ( "configure: {}" , String :: from_utf8_lossy( & output. stdout) ) ;
313
313
@@ -346,7 +346,7 @@ fn build() -> io::Result<()> {
346
346
347
347
fn check_features (
348
348
include_paths : Vec < PathBuf > ,
349
- infos : & Vec < ( & ' static str , Option < & ' static str > , & ' static str ) > ,
349
+ infos : & [ ( & ' static str , Option < & ' static str > , & ' static str ) ] ,
350
350
) {
351
351
let mut includes_code = String :: new ( ) ;
352
352
let mut main_code = String :: new ( ) ;
@@ -527,11 +527,11 @@ fn check_features(
527
527
}
528
528
}
529
529
530
- fn search_include ( include_paths : & Vec < PathBuf > , header : & str ) -> String {
530
+ fn search_include ( include_paths : & [ PathBuf ] , header : & str ) -> String {
531
531
for dir in include_paths {
532
532
let include = dir. join ( header) ;
533
533
if fs:: metadata ( & include) . is_ok ( ) {
534
- return format ! ( "{}" , include. as_path( ) . to_str( ) . unwrap( ) ) ;
534
+ return include. as_path ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ;
535
535
}
536
536
}
537
537
format ! ( "/usr/include/{}" , header)
@@ -560,9 +560,7 @@ fn main() {
560
560
) ;
561
561
link_to_libraries ( statik) ;
562
562
if fs:: metadata ( & search ( ) . join ( "lib" ) . join ( "libavutil.a" ) ) . is_err ( ) {
563
- fs:: create_dir_all ( & output ( ) )
564
- . ok ( )
565
- . expect ( "failed to create build directory" ) ;
563
+ fs:: create_dir_all ( & output ( ) ) . expect ( "failed to create build directory" ) ;
566
564
fetch ( ) . unwrap ( ) ;
567
565
build ( ) . unwrap ( ) ;
568
566
}
@@ -658,7 +656,7 @@ fn main() {
658
656
659
657
check_features (
660
658
include_paths. clone ( ) ,
661
- & vec ! [
659
+ & [
662
660
( "libavutil/avutil.h" , None , "FF_API_OLD_AVOPTIONS" ) ,
663
661
( "libavutil/avutil.h" , None , "FF_API_PIX_FMT" ) ,
664
662
( "libavutil/avutil.h" , None , "FF_API_CONTEXT_SIZE" ) ,
0 commit comments